Professional Documents
Culture Documents
Labspg 2442
Labspg 2442
How
1. Find this session in the Cisco Live Mobile App
2. Click “Join the Discussion”
3. Install Spark or go directly to the space
4. Enter messages/questions in the space
cs.co/ciscolivebot#LABSPG-2442
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Agenda
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Overview of NSO
A two minute introduction to NETCONF/YANG
NETCONF
Network management protocol specifically designed to support service activation and provisioning.
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
A two minute introduction to NETCONF/YANG
YANG
Text based data modeling language designed for use with NETCONF.
• Operator friendly
• Precise
• Extensible
• Human readable
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
NSO architecture
Applications Engineers
• VNFM
• Controller Apps
• EMS and NMS
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
NSO for Network Engineers – User Interfaces
Auto-rendered Web UI with
powerful extensibility features
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
NSO for Network Engineers – User Interfaces
Cisco or Juniper-style CLI for network-
wide configuration changes
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
NSO Demo
Introduction to the NSO Lab
Introduction to the NSO Lab: Connecting to POD
• You have been assigned a POD consisting of two servers
• Connect to your POD using the AnyConnect credentials in your sheet
• Connect to environment
• Remote desktop to the PC Workstation
• SSH directly to the NSO server
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
Installing Cisco NSO is easy
• Obtain distribution file:
• nso-x.x.linux.x86_64.installer.bin
• It contains:
• NSO, examples, documentation
• NETSIM Network Simulator
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Setup an NSO Project Runtime Directory
• First make sure you stand in your home directory
$ cd
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
Starting Cisco NSO
• Move to nso-lab directory
$ cd nso-lab
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
NSO Directories
Two directory types:
Installation Directory
~/ nso/ 4.1/
Project Directory
4.2/ bin/
lib/
doc/
examples.ncs/ web-server/ ncs-cdb/
ncs.conf
datacenter/ ncs-cdb/
ncs.conf
nso-lab/ nso-cdb/
nso.conf
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Introduction to the NSO Lab
NSO web GUI
• In Windows server, open Chrome browser direct link to NSO “Web GUI”
• Use admin/admin as credentials
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
NSO Packages
Using Packages
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Using Existing Packages
• Existing packages:
• NEDS ($NCS_DIR/packages/neds)
• Services ($NCS_DIR/packages/services)
• Tools ($NCS_DIR/packages/tools)
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
Reloading Packages
• Check if all the required packages are loaded using show packages command
• Package reload can be forced using request packages reload command
• Package reload can be forced with starting NSO using —with-package-reload flag
$ ncs_cli –C –u admin
admin@ncs# packages reload
admin@ncs# show packages package package-version
PACKAGE NAME VERSION
----------------------
cisco-ios 3.0
dell-ftos 3.0.1
admin@ncs# exit
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Using Netsim
Netsim Overview
ncs-netsim is a network devices
simulation tool
Used to test NSO with simulated devices
Uses NED device packages
A NED package contains netsim directory Netsim simulated
Represents device configuration and CLI devices (ConfD)
The same YANG for models are used for
simulated and real devices
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Starting Simulated Devices
• Below example creates 3 Cisco IOS devices and 2 dell force10 devices
$ ncs-netsim create-network packages/cisco-ios 3 c
DEVICE c0 OK STARTED
DEVICE c1 OK STARTED
...
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Access Simulated Devices
• You can run the CLI towards the simulated devices
$ ncs-netsim cli-i c1
c1> enable
class-map m
match qos-group 1
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Task 2: NSO Device Manager
Device Manager
• Is the heart of NSO
• NSO keeps a master copy of configuration in CDB
• Network element drivers (NED) supports different protocols:
• NETCONF
Master Copy of
• SNMP
Configurations
• CLI
• Generic NED (Java code)
Device Manager
Network Element Driver
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
Load netsim devices in NSO
• First we export the NETSIM devices connection data:
$ ncs-netsim ncs-xml-init > devices.xml
$ ncs_cli –C -u admin
# configure terminal
ncs(config)# commit
ncs(config)# exit
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
NSO CLI
• In Operational mode, the CLI displays operational data stored in CDB (or live
data from the devices). In Configuration mode, the CLI displays network
# configuration data
operational mode CLIstored in CDB > operational mode CLI
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
Device Configuration Management
Synchronizing from Device
• Device Configurations in NSO and actual Device Configuration should match
• After initial device discovery or import, it makes sense to synchronize
configurations from devices
sync-to
ncs# devices sync-from sync-from
check-sync
sync-result { compare-config
device c0
result true
}
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Synchronizing to Device
• When a device has been configured out of band
• Clears up rogue configuration
• “dry-run” option available to check changes sync-to
sync-from
ncs# devices device c0 sync-to check-sync
compare-config
result true
Change device
configuration over CLI.
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Check Sync
• Check if a device has been configured out of band
ncs# devices check-sync
sync-result {
device c0
result in-sync
}
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
Configuring Devices
• Configuration change happens after final commit statement
ncs# config
Entering configuration mode private
[ok][2010-04-14 14:28:33]
[edit]
ncs(config)# devices device c0 config ios:interface GigabitEthernet 0/1 ip address 10.10.10.1
255.255.255.0
[ok][2010-04-14 14:28:38]
[edit]
admin@ncs(config-if)# devices device c1 config ios:interface GigabitEthernet 0/2 ip address
10.10.10.20 255.255.255.0
[ok][2010-04-14 14:28:51]
[edit]
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Displaying Configuration
• Display only new parts of configuration:
ncs(config)# top
ncs(config)# show configuration devices device c0
devices device c0
config
ios:interface GigabitEthernet0/1
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Commit changes
• Dry-run changes
ncs(config)# commit dry-run
----
ncs(config)# commit dry-run outformat native
----
• Commit to devices
ncs(config)# commit
• Exit
ncs(config)# exit
admin@ncs# exit
cisco@NCS:~/nso-lab$
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Rollbacks
• Every transaction has a corresponding rollback file:
$ ls logs/rollback*
$ more logs/rollback10001
• Or NSO CLI:
> file show logs/rollback<TAB>
ncs(config)# file show logs/rollback<TAB>
Load rollback
ncs(config)# rollback configuration <TAB>
Possible completions:
0 - 2011-09-23 09:19:43 by admin via cli
1 - 2011-09-23 09:15:38 by admin via cli
2 - 2011-09-23 09:13:35 by admin via cli
3 - 2011-09-23 08:55:31 by admin via cli
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 43
Rollbacks – Examples
• Rollback with the highest number is the most recent rollback file
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Rollbacks – Examples
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
Comparing Configuration
• Compare out-of-sync device configuration
ncs(config)# devices device c0 check-sync
result out-of-sync
info got: 290fa2b49608df9975c9912e4306110 expected: ef3bbd344ef94b3fecec5cb93ac7458c
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
Templates and Groups
Device groups
• Create a group and add devices
admin@ncs(config)# devices device-group C device-name c0
admin@ncs(config-device-group-C)# device-name c1
admin@ncs(config-device-group-C)# device-name c2
admin@ncs(config-device-group-C)# device-name dell0
admin@ncs(config-device-group-C)# top
admin@ncs(config)# show configuration
devices device-group C
device-name [ c0 c1 c2 dell0 ]
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 48
Templates
• Used to apply snippets of configuration
Create template:
ncs(config)# devices template snmp-settings config ios:snmp-server host 192.168.216.23 community-
string secret
ncs(config)# devices template snmp-settings config ios:snmp-server location Stockholm
ncs(config)# top
ncs(config)# show configuration
ncs(config)# commit
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
Task 3: NSO Service Manager
YANG Intro
Basic YANG Statements
YANG Programming Equivalent Description
Leaf Variable Contains a single value of a specific type
List Array of Records Contains a list of zero or more sets of values and other
statements (hierarchy)
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 52
YANG Supports a Number of Data Types
Built-in Types Derived Types
Name Description typedef my-base-int32-type {
type int32 {
int8/16/32/64 Integer range "1..4 | 10..20";
}
uint8/16/32/64 Unsigned integer }
decimal64 Non-integer
typedef derived-int32 {
string Unicode string type my-base-int32-type {
enumeration Set of alternatives range "11..max";
}
boolean True or false }
bits Boolean array typedef string255 {
binary Binary BLOB type string {
length "1..255";
leafref Reference }
}
identityref Unique identity
empty No value, void typedef derived-str {
type string255 {
union Choice of member types length "11 | 42..max";
pattern "[0-9a-fA-F]*";
instance-identifier References a data tree node }
}
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 53
Leaf Attributes
Attribute Description
Whether this leaf is a configurable value ("true") or operational
config
value ("false"). Inherited from parent container if not specified
default Specifies default value for this leaf. Implies that leaf is optional
mandatory Whether the leaf is mandatory ("true") or optional ("false")
must XPath constraint that will be enforced for this leaf
type The data type (and range etc) of this leaf
when Conditional leaf, only present if XPath expression is true
description Human readable definition and help text for this leaf
reference Human readable reference to some other element or spec
units Human readable unit specification (e.g. Hz, MB/s, ℉)
status Whether this leaf is "current", "deprecated" or "obsolete"
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 54
Service Design
Creating a Service Package
Create a Service Skeleton
1. Create a package skeleton
1.
Service Template Service Model
2. Use the Cisco NSO CLI to Skeleton File (XML) Skeleton File (YANG)
configure a sample service
Configure Sample Service
3. Create the service template using Cisco NSO CLI
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
Create a package skeleton
• $ cd
• $ cd nso-lab
• $ cd packages
• $ ncs-make-package --service-skeleton template trunk
• $ ls trunk/
• load-dir
• package-meta-data.xml
• src
• templates
• test
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
Creating a Service Package
Create a Service Skeleton
• Create a package skeleton
Service Template Service Model
• Use the Cisco NSO CLI to Skeleton File (XML) Skeleton File (YANG)
configure a sample service
Configure Sample Service
using Cisco NSO CLI
2.
• Create the service template
Create Service Template
• Create the service model in YANG (XML)
• Compile and deploy the package Create Service Model
(YANG)
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 58
Configure the Service via NSO
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 59
Creating a Service Package
Create a Service Skeleton
• Create a package skeleton
Service Template Service Model
• Use the Cisco NSO CLI to Skeleton File (XML) Skeleton File (YANG)
configure a sample service
Configure Sample Service
• Create the service template using Cisco NSO CLI
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 60
XML Template
• admin@ncs(config)# show full-configuration devices device dell0 config
force10:interface Vlan | display xml
• admin@ncs(config)# show full-configuration devices device c0 config
ios:interface GigabitEthernet 0/23 | display xml
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Creating a Service Package
Create a Service Skeleton
• Create a package skeleton
Service Template Service Model
• Use the Cisco NSO CLI to Skeleton File (XML) Skeleton File (YANG)
configure a sample service
Configure Sample Service
• Create the service template using Cisco NSO CLI
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
Create the Yang Model
list endpoint {
key device;
leaf device {
type leafref {
path ”/ncs:devices/ncs:device/ncs:name”;
}
}
leaf interface {
type string;
}
}
leaf vlan {
type uint16;
}
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 63
Creating a Service Package
Create a Service Skeleton
• Create a package skeleton
Service Template Service Model
• Use the Cisco NSO CLI to Skeleton File (XML) Skeleton File (YANG)
configure a sample service
Configure Sample Service
• Create the service template using Cisco NSO CLI
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 64
Compile and reload the package
• $ cd packages/trunk/src
• $ make
• $ ncs_cli -C -u admin
• admin@ncs # packages reload
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 64
Create a service instance
• $ ncs_cli -C -u admin
• admin@ncs # config
• admin@ncs(config)# services trunk myservice endpoint c0 interface 0/2
admin@ncs(config-endpoint-c0)# endpoint dell0 interface GigabitEthernet0/12
• admin@ncs(config-endpoint-dell0)# vlan 12
• admin@ncs(config)# top
• admin@ncs(config)# show full-configuration services trunk
• admin@ncs(config)# commit dry-run outformat native
• admin@ncs(config)# commit
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
Summary
• Service design goal is simplicity for the operator :
»Minimum set of parameters for the service (optimization)
»Strict enforcement of parameters to minimize human error
(standardization)
»Thorough testing of service configuration and all possible service options
to ensure robustness of the solution
• NSO and YANG provide modularity and flexibility for service designers
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 67
Conclusion
Cisco Spark
Questions?
Use Cisco Spark to communicate
with the speaker after the session
How
1. Find this session in the Cisco Live Mobile App
2. Click “Join the Discussion”
3. Install Spark or go directly to the space
4. Enter messages/questions in the space
cs.co/ciscolivebot#LABSPG-2442
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
• Please complete your Online Complete Your Online
Session Evaluations after each
session
Session Evaluation
• Complete 4 Session Evaluations
& the Overall Conference
Evaluation (available from
Thursday) to receive your Cisco
Live T-shirt
• All surveys can be completed via
the Cisco Live Mobile App or the
Communication Stations
Don’t forget: Cisco Live sessions will be available
for viewing on-demand after the event at
www.ciscolive.com/global/on-demand-library/.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Cisco Automation and Orchestration at Cisco Live 2018
• Service Provider demos at World of Solutions:
• Carrier-Class Cisco NFV
• Multi-Domain Orchestration
• Multi-Layer and Multi-vendor Optical
• Segment Routing
• Managed SD-WAN
• 5G Enterprise Network Slicing
• Other Demos at Cisco live using our Automation and
Orchestration products:
• IoT/Fog computing demos power by NSO/ESC
• NSO booth in the Technical Solution Clinic at the Hub
• Partners Booths with NSO demos:
• LiveAction
• NIL
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 71
NSO DevNet – Key Highlights
The one place to use for sharing, finding and collaborating on NSO public
knowledge
LABSPG-2442 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 73
Thank you