Brkops 2418
Brkops 2418
Brkops 2418
Segment Routing
using Cisco Network Services Orchestrator
Michael Maddern
Technical Marketing Engineer
BRKOPS-2418
Cisco Webex Teams
Questions?
Use Cisco Webex Teams to chat
with the speaker after the session
How
1 Find this session in the Cisco Events Mobile App
2 Click “Join the Discussion”
3 Install Webex Teams or go directly to the team space
4 Enter messages/questions in the team space
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
Agenda
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
What is
Segment Routing?
Segment Routing is a flexible,
scalable way of doing source
routing.
Segment Routing
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
Segment Routing | Segment IDs
Prefix SID
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
Segment Routing | Segment IDs
Adjacency SID
201
201
between two routers.
MPLS IS-IS
Since the adjacency SID is 16005
202
203
relative to a specific router, it is
locally unique and dynamically
allocated by the device. 201
202
16003 16004
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
Segment Routing | Paths
Dynamic Path
201
201
to forward traffic using the
shortest path to router E MPLS IS-IS
(a-b-e). 16005
202
203
201
202
16003 16004
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
Segment Routing | Paths
Explicit Path
16004
Router A, sending traffic to 201
router E, packet
202
203
16001 16002
pushes label stack
(16004, 201)
201
201
to reach router E, using the MPLS IS-IS
shortest path to router D 16005
202
203
(a–c-d or a-b-d),
and then through an explicit 201
interface onto the 202
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
Segment Routing | Fast Reroute
TI-LFA | Topology Independent Loop Free Alternative
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Segment Routing | Value Proposition
Simpler Deployable
Fewer protocols Seamless Brownfield Integration
Stateless traffic engineering Single Control for Inter Domain
Implementations
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
Segment Routing | Configuration
Enabling Segment Routing
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
Network
Programmability
Network Programmability
What are the options?
Paramiko
Netmiko
NAPALM
/(Reg[Ex])?/
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Network Programming
What are the options?
© 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
Network Programmability | YANG
A better alternative
YANG
Running
NETCONF is the protocol that applies the Datastore
changes to the datastore on the device.
Network Device
BRKMPL-2210 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
Network Programmability | YANG
Yet Another Next Generation (RFC 6020 and 7950)
A structured, well-defined
representation of config and
operational data types.
Providing a programmable
network interface.
Decoupled from transport,
protocol and encoding.
Wide standards support and open
source tooling.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Network Programmability | YANG
NETCONF / YANG stack
BRKMPL-2210
© 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
Network Programmability | YANG
module: Cisco-IOS-XR-clns-isis-cfg-example
+--rw isis
+--rw instances
+-- rw instance* [instance-name] KEY
+-- rw instance-name string DATA TYPE LEAF
+-- rw srgb!
| +-- rw lower-bound uint32
CNTR
CONTAINER
CONTAINER
CONTAINER
CONTAINER
DATA
| | | | +-- rw value uint32 LEAF
LIST
LIST
LIST
TYPE
| | | | +-- rw nflag-clear BRKOPS-2418 enumeration
© 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
Network Programmability | YANG
Where do YANG models come from?
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
Network Programmability | YANG
Summary
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Why automate
with NSO?
Orchestration for Network automation
Operational Value should
• Instantiate network intent
• Require minimal user input
• Enforce best practices
• Handle failure
• Handle rollout and rollback
• Provide transactional
guarantees
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Automation to Enforce Best Practices
Almost nothing is unique to a given device
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 28
Cisco Network Services Orchestrator
Key Features
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Cisco Network Services Orchestrator
High-Level Architecture
Package
CDB
Manager Seamless integration
Device Manager with existing and future
OSS/BSS environment
Device Abstraction Elastic Services Controller (VNFM)
Loosely-coupled and
VNF Lifecycle VNF Service modular architecture
NED NED NED
Manager Monitoring leveraging open APIs and
standard protocols
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
The Industry’s Broadest Multi-Vendor Support
Over 170 Supported NEDs — Customization Available
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Migrating to Segment Routing using NSO
Benefit Summary
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 32
Migrating to
Segment Routing
Migrating to Segment Routing
Small Steps, Incrementally Validated
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Migrating to Segment Routing
Enable Segment Routing in the IGP Address Family
Cisco IOS-XR CLI Cisco IOS-XR Native YANG Data Model
module: Cisco-IOS-XR-clns-isis-cfg
+--rw isis
+--rw instances
+--rw instance* [instance-name]
router isis CORE +--rw instance-name string
+--rw afs
address-family ipv4 unicast
+--rw af* [af-name saf-name]
segment-routing mpls +--rw af-name address-family
+--rw saf-name sub-address-family
+--rw af-data!
+--rw segment-routing
+--rw mpls? label-preference
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
Migrating to Segment Routing
Enable Segment Routing in the IGP Address Family
Cisco IOS-XR CLI OpenConfig YANG Data Model
module: openconfig-network-instance
+--rw network-instances
+--rw network-instance* [name]
+--rw name -> ../config/name
+--rw protocols
router isis CORE +--rw protocol* [identifier name]
address-family ipv4 unicast +--rw identifier -> ../config/identifier
segment-routing mpls +--rw name -> ../config/name
+--rw isis
| +--rw global
| +--rw segment-routing
| +--rw config
| +--rw enabled? boolean
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
Migrating to Segment Routing
Configure the Prefix SID under the IGP Loopback Interface
Cisco IOS-XR CLI Cisco IOS-XR Native YANG Data Model
module: Cisco-IOS-XR-clns-isis-cfg
+--rw isis
+--rw instances
+--rw instance* [instance-name]
+--rw instance-name string
+--rw interfaces
router isis CORE | +--rw interface* [interface-name]
interface Loopback 0 | +--rw interface-name string
address-family ipv4 unicast | +--rw interface-afs
prefix-sid absolute 16001 | | +--rw interface-af* [af-name saf-name]
| | +--rw af-name address-family
| | +--rw saf-name sub-address-family
| | +--rw interface-af-data
| | | +--rw prefix-sid!
| | | | +--rw type enumeration
| | | | +--rw value uint32
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Migrating to Segment Routing
Configure the Prefix SID under the IGP Loopback Interface
Cisco IOS-XR CLI OpenConfig YANG Data Model
module: openconfig-network-instance
+--rw network-instances
+--rw network-instance* [name]
+--rw name -> ../config/name
+--rw protocols
+--rw protocol* [identifier name]
+--rw identifier -> ../config/identifier
+--rw name -> ../config/name
+--rw isis
| +--rw interfaces
router isis CORE | +--rw interface* [interface-id]
| +--rw interface-id -> ../config/interface-id
interface Loopback 0 | +--rw levels
| | +--rw level* [level-number]
address-family ipv4 unicast | | +--rw level-number -> ../config/level-number
prefix-sid absolute 16001 | | +--rw afi-safi
| | | +--rw af* [afi-name safi-name]
| | | +--rw afi-name -> ../config/afi-name
| | | +--rw safi-name -> ../config/safi-name
| | | +--rw segment-routing
| | | | +--rw prefix-sids
| | | | +--rw prefix-sid* [prefix]
| | | | +--rw config
| | | | | +--rw prefix? ip-prefix
| | | | | +--rw sid-id? sr-sid-type
| | | | | +--rw label-options? enumeration
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Migrating to Segment Routing
Enable TI-LFA under every ISIS Interface
Cisco IOS-XR CLI Cisco IOS-XR Native YANG Data Model
module: Cisco-IOS-XR-clns-isis-cfg
+--rw isis
+--rw instances
+--rw instance* [instance-name]
| +--rw instance-name string
| +--rw interfaces
router isis CORE | +--rw interface* [interface-name]
interface GigabitEthernet0/0/0/0 | | +--rw interface-name string
| | +--rw interface-afs
address-family ipv4 unicast
| | +--rw interface-af* [af-name saf-name]
fast-reroute per-prefix | | +--rw af-name address-family
fast-reroute per-prefix ti-lfa | | +--rw saf-name sub-address-family
| | +--rw interface-af-data
| | | +--rw interface-frr-table
| | | | +--rw frrtilfa-types
| | | | | +--rw frrtilfa-type* [level]
| | | | | +--rw level internal-level
| | | | | +--rw type frr
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
What about
Testing?
Testing Network Configuration with NSO
Operational Data
NSO can make decisions and conditionally apply device configuration based
on this operational data.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Segment Routing Migration Connectivity Tests
Step 1 | Enable Segment Routing
Ping test
• Executes an SR MPLS IGP ping to every other router in the domain.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Segment Routing Migration Connectivity Tests
Step 2 | Prefer Segment Routing
CEF validation
The Prefix SID entry in the Forwarding Information Base (FIB) is checked to ensure the
SR label is imposed.
Ping test
Re-run step 1 tests.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 43
Segment Routing Migration Connectivity Tests
Step 3 | Disable LDP
Only after all connectivity tests have passed will NSO allow the disable LDP
step.
NSO will remove all LDP interfaces for connections between the routers in
the IGP domain.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Demo
https://github.com/NSO-developer/sr-migrate
Service YANG Model
Network-wide model for Segment Routing enablement
module: sr-migrate
+--rw sr-infrastructure
| +--rw srgb
| +--rw lower-bound? sid
| +--rw upper-bound? sid
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
Service YANG Model
Network-wide model for Segment Routing enablement
module: sr-migrate
+--rw igp-domain* [name]
+--rw name string
+--rw sid-pool -> /ralloc:resource-pools/idalloc:id-pool/name
+--rw loopback? uint8
+--rw address-family? enumeration
+--rw router* [name]
| +--rw name -> /ncs:devices/device/name
| +--rw custom-prefix-sid? sid
| +--ro prefix-sid? sid
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 47
Service YANG Model
Network-wide model for Segment Routing enablement
module: sr-migrate
augment /ncs:services:
+--rw sr-migrate* [igp-domain]
+--rw igp-domain -> /igp-domain/name
+--rw enable-segment-routing? boolean
+--rw prefer-sr-imposition? boolean
+--rw disable-ldp? boolean
+--ro connectivity-test-results
+--ro label-imposition-test-results
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 48
Segment Routing Migration Service
Configuration Summary
For each router in the IGP domain, NSO will generate the following config:
Step 1
• The Segment Routing Global Block (SRGB).
• A unique prefix SID on the loopback interface.
• TI-LFA on all non-loopback router interfaces.
Step 2
• Segment Routing label imposition preference.
Step 3
• LDP interface configuration removed.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
Segment Routing Migration Service
Programmatically removing the LDP interfaces with NSO
NSO allows the entire network configuration to be read and updated programmatically
through the Python Maagic API using the device YANG models.
NSO manages the device credentials and connections, providing transactional
guarantees. The Python code simply reads / updates the device model data in the
NSO CDB.
Using the Python Maagic API reduces the complexity of programming towards NSO:
• Allows the device models to be navigated using standard Python object dot
notation, giving very clear and readable code.
• Provides context handlers, removing the need to close sockets, user sessions and
transactions, and avoiding the problems when they are forgotten and kept open.
• Removes the need to know the data types of the leafs.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 50
Segment Routing Migration Service
Programmatically removing the LDP interfaces with NSO
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 51
Segment Routing Migration Service
Programmatically removing the LDP interfaces with NSO
connections = defaultdict(list)
device = root.devices.device[router.name]
for interface in device.config.ifmgr_cfg__interface_configurations.\
interface_configuration:
addr = interface.ipv4_io_cfg__ipv4_network.addresses.primary
ip_network = IPv4Interface(unicode('%s/%s' % addr.address,
addr.netmask)).network
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 52
Segment Routing Migration Service
Programmatically removing the LDP interfaces with NSO
if len(connection) == 2:
for (device_name, interface_name) in connection:
device = root.devices.device[device_name]
ldp_interfaces = device.config.mpls_ldp_cfg__mpls_ldp.\
default_vrf.interfaces.interface
if interface_name in ldp_interfaces:
del ldp_interfaces[interface_name]
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 53
Demo Screenshots
Segment Routing Migration Service
sr-migrate YANG model | IGP Domain Definition
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Segment Routing Migration Service
sr-migrate YANG model | Service Parameters
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Segment Routing Migration Service
Step 1 | Enable Segment Routing | Commit Dry Run Output
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Segment Routing Migration Service
Step 2 | Prefer Segment Routing | Connectivity Test Results
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Segment Routing Migration Service
Step 2 | Prefer Segment Routing | Overall Service Progress Plan Viewer
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Segment Routing Migration Service
Step 3 | Disable LDP | Dry Run Native Output
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
Migrating to Segment Routing using NSO
Benefit Summary
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 61
NSO DevNet | Key Highlights
The one place for sharing, finding and collaborating on NSO public knowledge
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
WEDNESDAY THURSDAY FRIDAY
TUESDAY
BRKOPS-2700
Keynote NSO Access Control
9:30a.m.
8:30a.m.
BRKOPS-3339
NSO Reconciliation
BRKOPS-2695 11:00a.m. BRKOPS-2418 11:00a.m.
NSO Use Cases & Migration to BRKOPS-2383 11:15a.m.
Features Segment Routing NSO LSA
100K+ devices
BRKNMS-2733 12:15p.m.
NSO&Ansible with BRKOPS-1456
Business Process Orch 14:45a.m.
Camunda Workflow
Automation Platform
Keynote
5:00p.m.
OPS
Customer
Appreciation
7:00p.m.
Keynote 09:30
BRKSDN-2379 BRKNMS-3021
13 steps from an Advanced Cisco IOS 08:30
unprogrammed to a fully Device Instrumentation
BRKOPS-1871 automated network
Automate your SW 11:00 08:30
delivery process BRKSDN-2717 BRKOPS-3825
The hitchhiker's guide - Interpreting streaming 11:15
BRKNMS-2285 Managing your Network telemetry data using ML/AI
BRKNMS-2032
How to be a hero with 14:30 as Code (DevOps)
YANG Data Modeling and 09:00
Cisco DNA Center BRKPRG-2482 NETFCONF: Cisco and
Platform APIs PSOOPS-2236 Infrastructure as Code - 14:45 Industry Developments
Unlocking the power of 11:00 Building, Deploying,
BRKSDN-2497 open platform with Cisco Securing, Monitoring and
Build Your API-Based DNA Center Platform Managing Robust and
NW Troubleshooting Repeatable Networks Using BRKOPS-2285
Kit 17:00 Code and APIS Programmability with 11:30
BRKOPS-2562 BRKOPS-2024 IOS-XR Platforms
Wireless Automation & 16:45 Keynote 17:00
Data is the new Oil:
OPS
The Nuts & Bolts of Assurance with Cisco
Customer
leveraging Cisco DNA DNA Center using APIs
Appreciation 19:00
Assurance data for
creating value added
services
Network Programmability
Operations Track
#CLEMEA www.ciscolive.com/emea/learn/technology-tracks/operations.html
Complete your
online session
survey • Please complete your session survey
after each session. Your feedback
is very important.
• Complete a minimum of 4 session
surveys and the Overall Conference
survey (starting on Thursday) to
receive your Cisco Live t-shirt.
• All surveys can be taken in the Cisco Events
Mobile App or by logging in to the Content
Catalog on ciscolive.com/emea.
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
Continue your education
Demos in the
Walk-In Labs
Cisco Showcase
BRKOPS-2418 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
Thank you