Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Santiago Álvarez
Akshat SharmaJan 2018
Programmability and Your Network with Cisco IOS XR
@111pontes
@irakshat
@xrdocs
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Speed and scale demand software automation and data analytics
• Rapid innovation as competitive advantage
• One network operator per 1000s / 10000s of complex network devices.
Motivations for Network Programmability
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Cisco IOS XR Device Programmability
Data Plane
Control Plane
Management Plane
App
Controller
Orchestrator
Controller
Orchestrator
Data Plane
Control Plane
App
Model-Driven Manageability Service Layer API
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Model-Driven Manageability
Encoding XML JSON GPB
Protocol NETCONF gRPCRESTCONF
Models
APIs
Apps
Model-Driven APIs
YANG Development Kit (YDK)
YANG Models
(native, open)
App App App
SSH HTTPTransport
Model-Driven Configuration
Model-Driven Telemetry
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Benefits of Model-Driven Manageability
• Model based, structured, computer friendly
• Multiple model types (native, OpenConfig, IETF, etc.)
• Models decoupled from transport, protocol and encoding
• Choice of transport, protocol and encoding
• Model-driven APIs for abstraction and simplification
• Wide standard support while leveraging open source
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Data (config and operational) and actions (RPCs) in a tree structure
• Self-documented and shipped with devices
• Native models provide most coverage
• OpenConfig and IETF models are mapped to native models
Data Models In Cisco IOS XR
Cisco IOS XRNative
Open(OpenConfig / IETF)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Provide most comprehensive coverage for device functionality
• Approximately ~375 models in XR 6.3.1 (750+ YANG files)
• A single model defines either configuration (cfg), operational state (oper) or an action (act)
• Cisco-IOS-XR-ipv4-bgp-cfg
• Cisco-IOS-XR-ipv4-bgp-oper
• Cisco-IOS-XR-ipv4-bgp-act
• Models posted at
• https://github.com/YangModels/yang/tree/master/vendor/cisco/xr
Cisco IOS XR Native Data Models
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• OpenConfig models mapped to native models
• Comprehensive support in Cisco IOS XR (as of 6.3.1)
• bgp, bgp-policy
• Interfaces, if-aggregate, if-ethernet, if-ip
• lacp
• local-routing
• mpls
• platform
• rib-bgp
• routing-policy
• telemetry
• vlan
• channel_monitor, terminal_device, optical_amplifier, transport_line_common, transport_line_protection, transport_types
OpenConfig Data Models In Cisco IOS XR
Cisco IOS XRNative
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Network Engineer
Skills
• Proficient in network protocols and network management
• No or minimal programming experience
Requires
• Simple programming abstractions
• Avoid programming complexities of management protocols, encodings, transport and YANG
Software Developer
Skills
• Proficient in software development and automation
• No or minimal experience with network protocols and network management
Requires
• Software development kit
• Avoid learning curb of management protocols, encodings, transport and YANG
Two User Profiles for Network Programmability
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Simplify app development
• One-to-one correspondence between model and class hierarchy
• Abstract protocol, transport, encoding, modeling language
• API generated from YANG model
• Rich data validation
• Multi-language (Python, C++, Go, etc.)
Model-Driven APIs
YANG ModelClass Hierarchy
(Python, C++, Go)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Simplicity through abstractions (model bundles, services, providers)
• Rich data validation (type, value, semantics, config/oper)
• Multilanguage support (Python, C++)
• New infrastructure introduced release 0.6.0
• Improved data validation (dynamic model download)
• More providers (RESTCONF, OpenDaylight)
• Low-level Path API (no model bundles required)
• Improved data filtering (config/oper)
• Rapid development
• Initial release 0.3.0 - March 2016
• Latest release 0.6.3 - December 2017
YANG Development Kit (ydk.io)
CRUD / NETCONF / Executor
NETCONF / RESTCONF / OpenDaylight
Cisco IOS XR
OpenConfig IETFCisco IOS XEModel
Bundles
Services
Providers
Cisco IOS XR
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
A YDK-Py “Hello World” Using OpenConfig BGP
# Cisco YDK-Py OC-BGP “Hello world”from ydk.services import CRUDServicefrom ydk.providers import NetconfServiceProviderfrom ydk.models.openconfig import openconfig_bgp as oc_bgp
if __name__ == "__main__":provider = NetconfServiceProvider(address="10.0.0.1",
port=830,username=“admin”,password=“admin”,protocol=“ssh”)
crud = CRUDService() # create CRUD servicebgp = oc_bgp.Bgp() # create oc-bgp objectbgp.global_.config.as_ = 65000 # set local AS numbercrud.create(provider, bgp) # create on NETCONF deviceprovider.close()exit()
# End of script
module: openconfig-bgp+--rw bgp
+--rw global| +--rw config| | +--rw as| | +--rw router-id?| +--ro state| | +--ro as| | +--ro router-id?| | +--ro total-paths?| | +--ro total-prefixes?
...
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Automated push of model data
• Facilitates close-loop automation
• Numerous use cases
• Network health
• Troubleshooting / remediation
• Performance tuning
• Capacity planning
• Security
• Cadence and event-based
• Collector dial-in or router dial-out
• Highly efficient processing and encoding
Model-Driven Telemetry
Configuration Telemetry
Controller(Network Analytics)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Cisco IOS XR Device Programmability
Data Plane
Control Plane
Management Plane
App
Controller
Orchestrator
Controller
Orchestrator
Data Plane
Control Plane
App
Model-Driven Manageability Service Layer API
• Batch updates straight to RIB, LSD (and more in the future), without going through Network state database.
• Streaming Notifications (e.g. BFD events, Interface events…)
Performance API for the “Do-it-yourself"system
• Bring your own Protocol –Use the same APIs that Network OS protocol stacks use internally, but over GRPC/thrift.
• Users can focus on higher layer protocols and Controller logic.
• Leverage Network OS infrastructure layer for Lower Level Functionality that includes scalability and data plane abstraction.
Offload Low-level tasks to Network OS
The case for Service Layer APIs
Model Driven Remote Procedure call (RPC) support
Enables consistency in Application Development.
gRPC, thrift are powerful RPC examples suitable for the performance requirements at this layer.
A clean separation of concerns between the infrastructure layer and management/Protocol layer.
It is crucial to have a singular focus for this layer – enabling Cisco to focus on just the right amount of software, with a complete API.
A Layered approach to APIs
Building Service Layer APIs for Today’s Use Cases
Models act as versioned Contracts – easier to understand, document and version.
Protobuf IDLs, or YANG are examples of IDLs that may be used to model this API layer.
Controllers
Service Layer API Architecture
SL-API Functionality Domains
InitializationRPCs
RIB RPCs
MPLS RPCs
InterfaceRPCs
BFDRPCs
gRPC Server (Router)
Protobuf Schema/Model
……
gRPC stub
gRPC stub
On-Box Client
Off-Box
ClientRequest
Response
Python, C++, go
Python, C++, go
“The Use Cases are Evolving ...”
Programmable Route Downloads
Controller/Agent
Programmable route downloads to CDN PoP routers to optimize TCAM space.
IOS-XR
IOS-XR
Traffic Engineering and Path Selection:
IOS-XR
IOS-XR
Controllers
Engineering paths for applications through Route/label manipulation, all based on user specific logic.
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XR
Bring your own Protocol/Agent
On-box agents and custom protocols (e.g. openR) that co-exist with Cisco protocols to influence routing.
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XR
IOS-XRIOS-XR
IOS-XR
IOS-XR
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Cisco IOS XR Device Programmability
Data Plane
Control Plane
Management Plane
App
Controller
Orchestrator
Controller
Orchestrator
Data Plane
Control Plane
App
Model-Driven Manageability Service Layer API
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Resources
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• YDK Portal - http://ydk.io
• Service Layer Documentation @xrdocs -https://xrdocs.github.io/cisco-service-layer
Resources
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
How to Get YDK-Py
Native Virtual Cloud
Install PythonInstall YDKDownload ydk-py-samples
Install VagrantInstall VirtualboxDownload ydk-py-samples
YANG Development Kit Sandbox
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
YDK Portal
• YDK at DevNet (http://ydk.io)
YDK Sample Apps
• YDK-Py sample apps (https://github.com/CiscoDevNet/ydk-py-samples) - Over 700 apps!
• YDK-Cpp sample apps (https://github.com/CiscoDevNet/ydk-cpp-samples ) - Coming soon
Sandboxes
• dCloud YANG Development Kit sandbox (https://goo.gl/RPpBvL)
• Ubuntu YDK Vagrant box (https://git.io/vaw1U)
Support
• Cisco support community (https://communities.cisco.com/community/developer/ydk)
Detailed YDK Resources
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
YDK Documentation
• YDK-Py docs (http://ydk.cisco.com/py/docs)
• YDK-Cpp docs (http://ydk.cisco.com/cpp/docs)
GitHub
• YDK Python API – YDK-Py (https://git.io/vaWsg)
• YDK-Py sample apps (https://git.io/vaw1U)
• YDK C++ API – YDK-Cpp (https://git.io/v1Cst) - alpha
• YDK-Cpp sample apps (https://git.io/v14Qh) - coming soon
Detailed YDK Resources (cont.)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Conferences
• NANOG 68: Ok, We Got YANG Data Models. Now What? (http://youtu.be/2oqkiZ83vAA )
• NANOG 71: Getting started with OpenConfig (https://youtu.be/L7trUNK8NJI)
• LinuxCon NA 2016: Simplifying Network Programmability Using Model-Driven APIs (https://goo.gl/W6tH2X)
Detailed YDK Resources (cont.)
Cisco IOS-XR Service Layer APIs
• Github: Check out the Obj-model repository on Github at
https://github.com/Cisco-Service-Layer/service-layer-objmodel
Proto definitions of the latest RPC versions Exhaustive python Unit Tests and tutorials to get
started
• @xrdocs: Blogs, Tutorials on Using Service Layer APIs and associated Libraries:
https://xrdocs.github.io/cisco-service-layer/
• APIdocs: Doxygen based documentation, auto-generated from the proto files:
https://xrdocs.github.io/cisco-service-layer/apidocs/
Github
APIdocs @xrdocs