praha, hotel clarion 10. network programming...network programming in a cisco open network...

65
© 2011 Cisco and/or its affiliates. All rights reserved. Cisco Connect 1 1 © 2013 Cisco and/or its affiliates. All rights reserved. Network Programming in a Cisco Open Network Environment Start using onePK and EEM Praha, Hotel Clarion 10. 11. dubna 2013 T-SDN4/L3 Bruno Klauser Consulting Engineer BN EMEAR CTO Team [email protected]

Upload: others

Post on 18-Jun-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2011 Cisco andor its affiliates All rights reserved Cisco Connect 1 1 copy 2013 Cisco andor its affiliates All rights reserved

Network Programming in a

Cisco Open Network Environment

Start using onePK and EEM

Praha Hotel Clarion

10 ndash 11 dubna 2013

T-SDN4L3

Bruno Klauser

Consulting Engineer BN EMEAR CTO Team bklauserciscocom

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 2

Highly motivated individuals

Full control over every single detail

Towards Collaborative operations of a partially autonomic system

From Detailed control by a single central authority

An Analogy

Highly skilled and trained crew

Human brain in every control loop

Specialized distributed crew

Reasonable control within boundaries

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 3

Software ndash Network Convergence

Donald Knuth 1974

(Author of ldquoThe Art of Computer Programmingrdquo)

Cisco Public 4 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 5

Describing Software Architectures

4+1 View Model

bull Scenarios Use Case Who What and Why Examples Routing-for-(Dollars) Application-Flow-Manipulation Network Slicing SDDC Provisioning CIN hellip

bull Development View SDKs Packages Libraries Tools Examples onePK SDK binaries so Eclipse Debugger IOL hellip

bull Logical View Features Functions Classes Abstractions Examples onePK APIs in C Java Application APIs hellip

bull Process View Architectures Processes Interactions Objects Examples Agents Controllers Thrift IDL Cloud Connectors Sentinels hellip

bull Physical View Deployment Hosting Topology Connectivity Examples Virtual Containers Blades Endpoints L1-2-3 Overlay

See httpsenwikipediaorgwiki4+1_Architectural_View_Model

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 2: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 2

Highly motivated individuals

Full control over every single detail

Towards Collaborative operations of a partially autonomic system

From Detailed control by a single central authority

An Analogy

Highly skilled and trained crew

Human brain in every control loop

Specialized distributed crew

Reasonable control within boundaries

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 3

Software ndash Network Convergence

Donald Knuth 1974

(Author of ldquoThe Art of Computer Programmingrdquo)

Cisco Public 4 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 5

Describing Software Architectures

4+1 View Model

bull Scenarios Use Case Who What and Why Examples Routing-for-(Dollars) Application-Flow-Manipulation Network Slicing SDDC Provisioning CIN hellip

bull Development View SDKs Packages Libraries Tools Examples onePK SDK binaries so Eclipse Debugger IOL hellip

bull Logical View Features Functions Classes Abstractions Examples onePK APIs in C Java Application APIs hellip

bull Process View Architectures Processes Interactions Objects Examples Agents Controllers Thrift IDL Cloud Connectors Sentinels hellip

bull Physical View Deployment Hosting Topology Connectivity Examples Virtual Containers Blades Endpoints L1-2-3 Overlay

See httpsenwikipediaorgwiki4+1_Architectural_View_Model

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 3: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 3

Software ndash Network Convergence

Donald Knuth 1974

(Author of ldquoThe Art of Computer Programmingrdquo)

Cisco Public 4 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 5

Describing Software Architectures

4+1 View Model

bull Scenarios Use Case Who What and Why Examples Routing-for-(Dollars) Application-Flow-Manipulation Network Slicing SDDC Provisioning CIN hellip

bull Development View SDKs Packages Libraries Tools Examples onePK SDK binaries so Eclipse Debugger IOL hellip

bull Logical View Features Functions Classes Abstractions Examples onePK APIs in C Java Application APIs hellip

bull Process View Architectures Processes Interactions Objects Examples Agents Controllers Thrift IDL Cloud Connectors Sentinels hellip

bull Physical View Deployment Hosting Topology Connectivity Examples Virtual Containers Blades Endpoints L1-2-3 Overlay

See httpsenwikipediaorgwiki4+1_Architectural_View_Model

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 4: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Cisco Public 4 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 5

Describing Software Architectures

4+1 View Model

bull Scenarios Use Case Who What and Why Examples Routing-for-(Dollars) Application-Flow-Manipulation Network Slicing SDDC Provisioning CIN hellip

bull Development View SDKs Packages Libraries Tools Examples onePK SDK binaries so Eclipse Debugger IOL hellip

bull Logical View Features Functions Classes Abstractions Examples onePK APIs in C Java Application APIs hellip

bull Process View Architectures Processes Interactions Objects Examples Agents Controllers Thrift IDL Cloud Connectors Sentinels hellip

bull Physical View Deployment Hosting Topology Connectivity Examples Virtual Containers Blades Endpoints L1-2-3 Overlay

See httpsenwikipediaorgwiki4+1_Architectural_View_Model

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 5: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 5

Describing Software Architectures

4+1 View Model

bull Scenarios Use Case Who What and Why Examples Routing-for-(Dollars) Application-Flow-Manipulation Network Slicing SDDC Provisioning CIN hellip

bull Development View SDKs Packages Libraries Tools Examples onePK SDK binaries so Eclipse Debugger IOL hellip

bull Logical View Features Functions Classes Abstractions Examples onePK APIs in C Java Application APIs hellip

bull Process View Architectures Processes Interactions Objects Examples Agents Controllers Thrift IDL Cloud Connectors Sentinels hellip

bull Physical View Deployment Hosting Topology Connectivity Examples Virtual Containers Blades Endpoints L1-2-3 Overlay

See httpsenwikipediaorgwiki4+1_Architectural_View_Model

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 6: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 6

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Development View

Logical View

Network

Programming

Process View

(Software)

Architectures and

Patterns

Physical View

Deployment and

Virtualization

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 7: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 7

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 8: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 8

Cisco Open Network Environment ndash ONE

Preserve What is Working

bull Resilience Scale Security

bull Functionality and Rich Features

bull Instrumentation

Evolve for New Requirements

bull Operational Simplicity and Automations

bull Programmability and Network-Awareness

bull Upcoming Innovations

Open and Integrated Framework

bull Software Defined Network concepts are a component of the Open Network Environment

bull Existing APIs Agents Controllers and Infrastructure contribute

Open Network Environment

Open Network Environment

Network

Programming

onePK

developerciscocom

CDN Training

Certification

Partners EEM EASy

(Software)

Architectures and

Patterns

Controllers

(ONEOpenflow PoC)

(SBC WLC +++)

CIN CloudConnect

Sentinels Agents

Deployment and

Virtualization

Nexus 1000v

CSR 1000v

VSG and vFWASA

vWAAS vNAM hellip

Cisco Openstack Ed

Blade Hosting

(UCS-E hellip) Virtual

Containers (AirVision

Cat ISR ASR hellip)

Scenarios and Motivations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 9: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 9

Flexible NetFlow

Auto IP SLAmdashdelay jitter packet loss

IP OAMmdashPing Trace Config CLI IP OAMmdashPing Trace BFD ISG per session

8023ahmdashLink monitoring and remote fault indication

8021 agmdashContinuity check L2 ping trace AIS

MPLS OAMmdashLSP ping LSP trace VCCV

EEMmdashEmbedded Event Manager

EVENT-MIBmdashOID-based triggers events or SNMP Set IETF DISMON

EXPRESSION-MIBmdashOID expression-based triggers IETF DISMON

hellip

Config CLImdashdiff logging lock replace rollback

E-LMImdashparameter and status signaling

E-DImdashEnhanced Device Interface CLI Perl IETF Netconf

EMM mdash Embedded Menu Manager

NETCONFmdashIETF NETCONF XML PI

CNS and WSMA TR-069 KRONmdashcommand

scheduler AutoInstallmdashbootstrapping IOSsh mdashIOS Shell SmartInstall Auto SmartPorts hellip

Flexible NetFlowmdash IETF IPFIX

BGP policy accounting ndash includes AS information

Periodic MIB bulk data collection and transfer

hellip

Auto IP SLAmdashdelay jitter loss probability

CBQoS MIBmdashclass-based QoS

NBAR RMON EPC ndash Embedded Packet

Capture ERMmdashEmbedded

Resource Manager GOLDmdashGeneric Online

Diagnosis Smart Call Homemdash

preventive maintenance VidMonmdashVideo Monitoring hellip

Fault Configuration Accounting Performance

Auto Securemdashone-touch device hardening LDP Authmdashmessage authentication Routing AuthmdashMD5 authentication BGP OSPF hellip

Security

Cisco IOSreg Device Manageability Instrumentation (DMI)

Fault Configuration Accounting Performance

Security

Headquarters DC

Device Manageability Instrumentation Has Evolved Significantly

Network Automation and Manageability

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 10: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Network Automation Life-Cycle Span

Network Automation spans across full Life Cycle

Operational Era Pre-Operational Era

Does it meet Requirements

Is it built to Specification

Post-Operational Era

How to take out of service

hellip

hellip

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 11: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Trigger a Workflow in the Network Problem Sometimes we want to receive remote information on a Router Switch and be able to react to it locally ndash for example a notification from a UPS System

Solution Use Network Automation based on Cisco IOS Embedded Event Manager leveraging the EEM SNMP Notification Event Detector

Router Switch can received SNMP Notifications

Execute (trigger) EEM Policy to take local action

Policy can query varbind info

Supports Incoming or Outgoing Notifications

Outgoing only for locally generated Notifications

Router(config event manager applet catch-a-trap

router(config-applet) description test snmp notification unmanaged service

router(config-applet) event snmp-notification oid 13616311410

oid-val 1361631153 op eq src-ip-address 105189176

direction incoming

router(config-applet) action 010 hellip

router(config-applet) action 020 hellip

Uninterruptible Power Supply

SNMP Trap ndash On Battery 5 Min Remaining

EEM EEM

Real-World Example

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 12: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Trigger a Workflow from the Network Problem A new rogue WLAN device in sensitive areas should be detected by Cisco CleanAir and automatically focuspanzoom a security camera

Solution Use Network Automation based on Cisco IOS Embedded Event Manager to receive an SNMP Notification from WLC and trigger the Video Operations Manager via HTTP

2 Rogue Device detected by CleanAir AP

2

6 Security Camera FocusPanZoom

6

3 WLC sends SNMP Notification

5 EEM notifies VSOM via HTTP

1 Rogue WLAN Device added

1

ATM

4 EEM triggers upon SNMP Notification

EEM 4

Real-World Example

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 13: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Problem How to actively gather and share information from a router and from a few devices behind the router ndash across organizational and technical borders

Solution 1 Initiate a project to make use of SNMP Syslog Event Management Software Reporting Provisioning and CRM Systems

Solution 2 Use Cisco IOS Network Automation to collect and post the information

namespace import http

Using Cisco IOS Embedded Event Manager and Tcl

1 Import the http package into EEM policy

2 Collect the information required

set my_query [httpformatQuery status $my_info]

3 Build a query for the http POST operation

set my_reply [httpgeturl $my_server_url -query $my_query]

4 POST the information to a website

Collect and Share Remote Information ndash 12

Real-World Example

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 14: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

See httptwittercomEASyDMI Note it is NOT recommended to use a public site or feed other than for demo purpose

Collect and Share Remote Information ndash 22

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 15: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 15

Embedded Event

Manager

Syslog email

notification

SNMP set

Counter

CLI

Applets

SNMP

get

SNMP

notification

Application

specific

TCL

Policies

Reload or

switch-over

EEM Applets

multi-event-correlation

IOSsh

Policies

Actions

Event Detectors

Syslog

Event

Process

Scheduler

Database

Interface

Descriptor

Blocks

Syslog

ED

Watchdog

ED

Interface

Counter

ED

CLI

ED

OIR

ED

ERM

ED

EOT

ED

RF

ED

none

ED

GOLD

ED

XML

RPC

ED

SNMP

EDs

Remote

bull Notification

Local

bull Notification

bull GetSet

NetFlow

ED

IPSLA

ED

Route

ED

Timer

EDs

bull Cron

bull Count

down

HW

EDs

bull Fan

bull Temp

bull Env

bull

CDP

LLDP

ED

8021x

ED

MAC

ED

Embedded Event Manager (EEM)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 16: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 16

Embedded Event Manager ndash Applet Evolutions EEM Version Release Applet Modifications Peanut Gallery Comments

10 120(26)S

123(4)T

2 Events Syslog SNMP

Actions Log CNS event Reload Switchover

Initial Version

Limited benefits

20

21

22

123(14)T1

122(18)SXF5

124M

No structure changes

Various New event detectors

New actions cli info mail policy SNMP trap Modify counters Publish

application events

Readset tracked objects

Many new actions

Popular CLI mail

Actions run linear

23 124(11)T maxrun support

pattern parameter for CLI actions

Maxrun support ==

security

Can handle CLI prompts

24 124(20)T multi-event support

Boolean correlation

of events within

applet

30 124(22)T

122(33)SE

Redesign of action mechanism

Program counter added

Loops conditionals regexps

context save error handling

Applets now rock

Programming language

feel

3132 - No changes -

40 152(2)T

Applet file actions

TLSSSL support for SMTP actions

Custom port for SMTP actions

File manipulation handy

16

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 17: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Example EEM Applets ndash Loops Variables

Problem None in Particular Solution Have fun exploring EEM Applet capabilities

See also httpwww99-bottles-of-beernetlanguage-cisco-ios-embedded-event-manager-applet-2909html

event manager applet 99-bob

description written by bklauser inspired by httpwww99-bottles-of-beernet

event none

action 100 set b 99

action 110 while $b gt 1

action 120 puts $b bottles of beer on the wall $b bottles of beer

action 130 decrement b

action 140 puts Take one down pass it around

action 150 puts $b bottles of beer on the walln

action 160 end

action 170 puts $b bottle of beer on the wall $b bottle of beer

action 180 puts Take one down pass it around

action 190 puts no more bottles of beer on the walln

action 200 puts No more bottles of beer on the wall

action 210 puts no more bottles of beer

action 220 puts Go to the store and buy some more

action 230 puts 99 bottles of beer on the walln

alias exec sing event manager run 99-bob

Setting a Variable

Decrementing a Variable

Referencing a Variable

While Loop ndash

While Loop ndash

Using an Alias to run our Applet

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 18: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Packaging Network Automations Problem Cisco IOS Embedded Automation Systems often include multiple configuration items files checks and procedures ndash how to ensure they are deployed consistently

Solution Cisco EASy provides a simple packaging mechanism and open-source EASy Installer A developer guide is available online to assist with the creation of EASy packages

MyPackagetar

Package Description

Pre-Requisite Verification

Pre-Installation Config

Pre-Installation Exec

Environment Variables

Configuration

Files

Post-Requisite Verification

Post-Installation Config

Post-Installation Exec

Uninstall

+

EASy Installer = Menu Guided Installation

Router easy-installer tftp10111mypackagetar flasheasy

-----------------------------------------------------------------

Configure and Install EASy Package lsquomypackage-103

-----------------------------------------------------------------

1 Display Package Description

2 Configure Package Parameters

3 Deploy Package Policies

4 Exit

Enter option 2

See httpwwwciscocomgoeasy EASy Package guide httptoolsciscocomsquishcEAe3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 19: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 19

Embedded Automation Systems (EASy)

1 Browse and Download EASy Packages wwwciscocomgoeasy

2 Make Sure to also download EASy Installer

3 Browse Other Embedded Automations wwwciscocomgociscobeyond

4 Learn About The Technology Under The Hood wwwciscocomgoinstrumentation wwwciscocomgoeem wwwciscocomgopec

5 Discuss Ask Questions Suggest Answers supportforumsciscocom supportforumsciscomobi

6 Upload your own Examples to CiscoBeyond wwwciscocomgociscobeyond

7 Engage via ask-easyciscocom

For Your Reference

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 20: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 20

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 21: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 21

ICT

Opera

tions

Operational Network Automation

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 22: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 22

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 23: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 23

ICT

Opera

tions

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

Inflection Business-Driven Network Automations hellip

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 24: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 24

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 25: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 25

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 26: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 26

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 27: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 27

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 28: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 28

Wireless Controller(s) (WLC etc hellip)

ICT

Opera

tions

Self-Service for Human Users

Network Survivability Manageability Automation

Virtual Overlay Networks

Business Operations

1

a

b

3

c

Operations

(FCAPS)

6 7 Resource

Allocation

5 Services

(Location Guestnet Onboarding hellip)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 29: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 29

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 30: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 30

ICT

Opera

tions

Inflection Network Programming

Network Survivability Manageability Automation Autonomy

Virtual Overlay Networks

Business Operations

1

a

b

3

Domain Controllers Domain Controllers

APIs and Agents

5

6 7

c

What if the lsquoUserrsquo is a Software App

2

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 31: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 31

Cisco ONE Platform Kit (onePK)

Any Cisco

Router or

Switch

YOUR

Applications

onePK

C JAVA Program

API Presentation

API Infrastructure

Catalyst Nexus ASR

ISR

onePK IPC Channel

Network Programming

Environment to

bull Innovate

bull Extend

bull Automate

bull Customize

bull Enhance

bull Modify

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 32: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 32

Cisco ONE Platform Kit (onePK)

onePK Provides

bull Abstractions (Service Sets)

bull Programmatic Interfaces (C Java (REST) hellip)

bull Software Development Kit (SDK)

Anatomy of a onePK Application

bull Software Application (currently C and Java)

bull Interfaces and Abstractions (Service Sets)

bull Communication Bus (Thrift IDL)

bull Connected-Apps Agent in Network OS

bull Network OS Features and Embedded Automations Write once run anywhere

Service Set Description Version v605 EFT 20122013

Data Path Provides packet delivery service to application Copy Punt Inject

Policy Provides filtering (NBAR ACL) classification (Class-maps Policy-

maps) actions (Marking Policing Queuing Copy Punt) and applying

policies to interfaces on network elements

Routing Read RIB routes addremove routes receive RIB notifications

Element Get element properties CPUmemory statistics network interfaces

element and interface events

Discovery L3 topology and local service discovery

Utility Syslog events notification Path tracing capabilities (ingressegress

and interface stats next-hop info etc)

Developer Debug capability CLI extension which allows application to

extendintegrate applicationrsquos CLIs with network element

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 33: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Cisco Public 33 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 34: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 34

YOUR

Applications

Ele

ment System

Interfaces

Discovery

CPU Memory Platform Serial Versions

Uptime Location OIR CLI Changes

Port Slot BW MTU TXRX BPS PPS Errors

Other Stats Config Link Changes

CDP Topology Graph Edges Nodes

Topology Changes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 35: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 35

YOUR

Applications

Ele

ment System

Interfaces

Discovery

Location

IP address MTU Clear Stats ShutNo Shut

Filters

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 36: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 36

char str = NULL

onep_element_connect(elemA user pwd NULL ampsh)

onep_element_get_property(elemA ampproperty)

if (property)

onep_element_to_string(elemA ampstr)

if (str)

fprintf(stderr nElement Info sn str)

free(str)

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 37: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 37

Monitor Memory Usage

bull Problem What if we need to dynamically investigate further upon a resource symptom

bull Solution Use the integration of EEM + ERM to trigger an EEM event when processor memory is greater than 80

resource policy

policy critmem global

system

memory processor

critical rising 80

interval 5

user global critmem

event manager applet totmemcheck

event resource policy critmem

action 100 mail server ldquoltservergtrdquo to ldquolttogtrdquo from ldquoltfromgtrdquo subject

ldquoWarning proc memory spikerdquo

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 38: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 38

A Network ldquoToprdquo

bull Use onePK to build a live process monitor similar to UNIX top

bull The same app can connect to multiple devices to display the top processes across the entire network

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 39: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 39

YOUR

Applications

RIB Next-Hop metric AD scope (VRF) Changes

Configured Classes

Configured ACLs

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 40: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 40

Static routes

Service-Policies (Police Mark Shape Queue)

ACLs

YOUR

Applications

Polic

y

Routing

QoS

Security

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 41: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 41

bull Getting Routes

bull Setting Routes

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 42: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 42

Example Routing for Dollars CO2 Tulips hellip

Setup

bull EIGRP

bull Routing Topology

bull No External Metrics

bull No External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 43: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 43

Example Routing for Dollars CO2 Tulips hellip

Application Routes

bull EIGRP

bull onePK

bull External Metrics

bull External Algorithm

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 44: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 44

Example Routing for Dollars CO2 Tulips hellip

router ospf 1

redistribute application ltapp namegt

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 45: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 45

Example Routing for Dollars CO2 Tulips hellip

bull Code Metrics

‒ Total lines of code 4700 (JAVA)

‒ 40 SWING GUI

‒ 20 Dijkstrarsquos algorithm lowest cost path determination

‒ 25 Housekeeping Node and link database

‒ 15 Calls to onePK infrastructure + error checking

bull Code increase to add ldquoLatency based routingrdquo on top of ldquoRouting for Dollarsrdquo

‒ 100 lines of code

bull Modular code base written in Java has allowed us to port this to mobility client

Framework makes it easy to

modify code and change business

logic

Modular java code makes it easy

to deploy on multiple clients

Statistics and Metrics

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 46: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 46

Example Routing for Dollars CO2 Tulips hellip

Path determination

based on lowest latency

Latency information fed

into app through IPSLA

Port to mobility

client

Recent Extensions

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 47: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 47

YOUR

Applications

Data Plane Copy or Punt Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 48: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 48

YOUR

Applications

Data Plane Inject New or Modified Packets

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 49: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 49

TRY(rc onep_dpss_register_for_packets(

ne1

dpss

targ_left

interesting_class

ONEP_DPSS_ACTION_PUNT

encrypt_callback

(void )intf_left

ampreg_handle) Register for packets)

Defines traffic of interest

Action to take on

interesting traffic

Where traffic goes next

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 50: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 50

Problem We need to custom encrypt packets of a specific application traffic flow

Solution Use onePK to punt encrypt and reinject the relevant packets

5

0

onePK application

onePK application

telnet

encrypt

encry

pt

encrypt

telnet telnet

1

1 Policy APIs on ingress router are set to

punt telnet and syslog to app

2 App encrypts punted traffic and re-

injects into data path

3 Policy APIs on egress router punt telnet

and syslog to app

4 App decrypts punted traffic and re-

injects into data path

5 Traffic that does not match policy

passes through unencrypted

2

3

4

http

http

http

Unsecure

Network 5

Real-World Example

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 51: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 51

5

1

What Client Sees What Wireshark Sees

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 52: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 52

Call Return

Request Response

synchronous

Publish Subscribe

iterative

Call Callback

Function

Subscribe + Filter

Notification

Handler

Request + Filter

Iterator

Callback

Event

Event

Iterations

Block Result 1

Examples - Get Element Version

- Set Interface Address

Examples - Getting 50rsquo000 ACLs

from an Element

Examples - Syslog Messages

- RIB Changes

Examples - Setting 50rsquo000 ACLs

on an Element

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 53: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 53

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 54: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 54

Portfolio of API Languages and Abstractions Network Programming with onePK and Embedded Network Automation

Native Network OS Embedded Automation

Event-Expression- MIB

PfR IPSLA Thresholds

Embedded Event

Manager Applets hellip

Advanced Network OS Embedded Scripting

Tcl Python Embedded

Event Manager EASy

hellip

Structured API

onePK C

Object Oriented API

onePK Java

Higher-Level Abstractions

Interfaces

onePK Libraries

REST XMPP Design

Patterns OMNI

Controllers hellip

Choice and Flexibility of Implementation

Network Automation ndash Embedded Automations

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 55: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 55

ICT

Opera

tions

Cisco ONE ndash Current Key Components hellip

Network Survivability Manageability Automation Autonomy

Domain Controllers Domain Controllers

Virtual Overlay Networks

Business Operations

APIs and Agents

APIs and Agents

APIs and Agents

1 4 5

6 7

c

a

b

2 3

onePK

onePK

CloudConnectors

Nexus 1000v CSR 1000v ASA 1000v VSG vWAAS ++

UCS-E Virtual Containers

Cis

co

Op

en

sta

ck

Ed

ition

Openflow

onePK

For Your Reference

Open Daylight Controller

ONE Controller

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 56: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Cisco Public 56 copy 2011 Cisco andor its affiliates All rights reserved

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 57: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 57

References ndash Programmable and Cloud-Intelligent

bull Cisco ONE ndash Open Network Environment httpwwwciscocomgoone

bull Cisco onePK ndash ONE Platform Kit httpwwwciscocomgoonepk

bull Cisco Developer Network httpdeveloperciscocomwebonepk

bull Cisco EASy ndash Embedded Automation Solutions httpwwwciscocomgoeasy

bull Cisco Scripting Community wwwciscocomgociscobeyond

bull Cisco Cloud Connectors ndash Blog httpblogsciscocomborderlessthe-network-is-the-path-to-accelerate-adoption-of-cloud-services

bull Cisco Cloud Connectors ndash Marketplace httpsmarketplaceciscocomcatalogsearchsearch[technology_category_ids]=938

For Your Reference

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 58: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Network Programming Hands-On Lab At CiscoLive Join us for TECNMS-3601 Advanced Network Automation or

1 Walk up to the WISP Labs

2 Book a seat for - Network Automation ndash The Basics - Network Automation ndash Intermediate - Network Automation ndash Advanced - Network Automation ndash Smart Call Home - Network Programming ndash The Basics - Network Programming ndash Intermediate - Network Programming ndash Advanced

Partners via PEC (currently being updated)

1 Navigate to httpwwwciscocomgopec

2 Click on gtLaunch

3 Search for sbquoNetwork Programminglsquo

4 Enjoy

Network Automation

For Your Reference

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 59: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Network Automation Hands-On Lab ndash 3 Levels

1 ndash Network Automation The Basics Task 101 ndash Working with EEM Applets ndash Hello World Task 102 ndash Working with EEM Tcl Policies ndash Hello World Task 103 ndash Working with EEM ndash CLI Event Detector Task 104 ndash Working with EEM ndash Regular Expressions Task 105 ndash Simple Command Logging ndash EEM CLI Event Detector Task 106 ndash Custom Interface Failover ndash using EEM IPSLA and Enhanced Object Tracking (EOT) Task 107 ndash Editing ASCII Files in IOS Task 108 ndash Using the IOS HTTP Client Task 199 ndash Sneak Peek onePK Custom Routing Application

2 ndash Network Automation Intermediate Service Planning Task 211 ndash Exporting Bulk Statistics Task 222 ndash Exporting upon Periodical Time Windows Service Deployment Task 221 ndash Installing an EASy Package ndash Extensible HTTP Server Task 222 ndash Creating an EASy Package ndash Hello World Task 223 ndash Configure Your Network for a onePK Application Task 224 ndash EASy Post-Deployment Manageability Verification Service Monitoring Task 231 ndash Monitoring Resources ndash Using ERM and EEM Task 232 ndash Monitor Application Traffic using Flexible NetFlow - NBAR Integration TBC Task 233 ndash Monitoring SLA ndash Using Cisco IOS Auto IPSLA (+ IPSLA ED) Service Troubleshooting Task 241 ndash Detecting Low-TTL Traffic Task 242 ndash Capturing Packets ndash Using Embedded Packet Capture Task 243 ndash Capturing Packets ndash Using the EASy EPC Package Task 244 ndash Logging SNMP Traps ndash Using the EASy Trap Logger

3 ndash Network Automation Advanced Service Planning Task 311 ndash EEM System Policies ndash Tune to Devicersquos EEM Capacity Service Deployment Task 321 ndash Using Tcl Libraries in EEM Policies ndash Pure Tcl Task 322 ndash Dynamically Configure from HTTP Input ndash Using a Pure Tcl Library Task 323 ndash Protect Your Intellectual Property ndash Signed Byte Code Service Monitoring Task 331 ndash Send Syslog Upon Route Change ndash EEM Routing Event Detector Task 332 ndash Monitoring Resource Groups ndash Using ERM and EEM Task 333 ndash Collecting Reliable Metrics ndash Using DCM IP SLA and EEM Service Troubleshooting Task 341 ndash EEM Applet ndash Testing and Debugging EEM Policies

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 60: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Network Programming Hands-On Lab ndash 3 Levels

1 ndash Network Programming The Basics Task 511 ndash Sample App Deploy and Run a onePK Application from Eclipse Task 402 ndash Sample App Routing for Dollars ndash Beyond Normal Routing Metrics Task 411 ndash Compile and Run a onePK C Application using make Task 412 ndash Compile and Run a onePK Java Application using mvn Task 421 ndash Create your own C onePK application Task 422 ndash Create your own Java onePK application

2 ndash Network Programming Intermediate Task 521 ndash Application Interaction with Custom CLI Task 531 ndash Application Interaction with Embedded Event Manager

3 ndash Network Programming Advanced Task 491 ndash Simulating a Network ndash IOL and NETMAPs Task 492 ndash Connecting to a Simulated Network ndash IOLTunnel Task 611 ndash Introspection Discover Service Sets supported

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 61: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Illustration in the bigger SDN and Automation Context Practical Examples and Hands-on Lab

Master Class Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

Join us for the Network Programming Master Class Series

Where do I start ndash can I do this What are Cisco ONE and onePK anyhow

Step-by-step introduction and adoption strategies Real-Life Examples and Case Studies

How can I successfully use Network Programming What have other Customers and Partners done

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 62: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2012 Cisco andor its affiliates All rights reserved Cisco Connect 62

Device Manageability Instrumentation (DMI) wwwciscocomgoinstrumentation

Embedded Event Manager (EEM) wwwciscocomgoeem

Cisco Beyond ndash EEM Community wwwciscocomgociscobeyond

Embedded Menu Manager (EMM) httptinyurlcomemm-in-124t

Embedded Packet Capture (EPC) wwwciscocomgoepc

Flexible NetFlow wwwciscocomgonetflow and wwwciscocomgofnf

GOLD httpwwwciscocomenUSproductsps7081products_ios_protocol_group_homehtml

IPSLA (formerly SAA formerly RTR) wwwciscocomgoipsla

Network Analysis Module httpwwwciscocomgonam

Network Based Application Recognition (NBAR) wwwciscocomgonbar

Security Device Manager (SDM) httpwwwciscocomgosdm

Smart Call Home wwwciscocomgosmartcall

Web Services Management Agents (WSMA) httptinyurlcomwsma-in-150M

Cisco Configuration Engine (CCE) wwwciscocomgociscoce

Feature Navigator wwwciscocomgofn

MIB Locator wwwciscocomgomibs

References ndash Instrumentation and Automation For Your

Reference

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 63: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

Network Programming and Automation Sustainable Innovation and Differentiation with Cisco Embedded Automation and onePK

What will YOU Program

Network Programming in a Cisco Open Networking Environment hellip

hellip provides Choice and Flexibility of

- APIs and Abstractions

- Architectures

- Deployment Models

hellip closes the gap between Business Applications and Networks

hellip enables Operational Savings and New Opportunities

hellip puts YOU in control

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 64: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2011 Cisco andor its affiliates All rights reserved 64 Cisco Connect 64 copy 2013 Cisco andor its affiliates All rights reserved

Prosiacuteme ohodnoťte tuto přednaacutešku

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost

Page 65: Praha, Hotel Clarion 10. Network Programming...Network Programming in a Cisco Open Network Environment Start using onePK and EEM , Hotel Clarion 10. – 11. dubna 2013 T-SDN4/L3 Bruno

copy 2013 Cisco andor its affiliates All rights reserved Cisco Connect 65

Děkujeme za pozornost