18
1 of 18 © 2010 Cisco Systems, Inc. All rights reserved LABNMS-2003 Cisco IOS-XR XML Network Management Table of Contents Cisco IOS-XR XML Network Management Overview ................................................. 1 Lab Topology ............................................................................................................... 2 XML Interface Architecture Overview .......................................................................... 4 XML Transport Types .................................................................................................. 5 TTY XML Agent ....................................................................................................... 5 XML Dedicated Agent .............................................................................................. 6 XML Schema Objects Overview.................................................................................. 7 Viewing XML Schema Objects ................................................................................ 8 XML Schema Definition Files ................................................................................... 9 XML Schema Objects: Browse Schema Definitions using HTML ............................ 9 XML Schema Objects: On the Router Schema Browser ....................................... 10 XML Request and Response Structure ..................................................................... 12 XML Request Structure ......................................................................................... 12 XML Response Structure ....................................................................................... 13 XML Native Data Operations ..................................................................................... 13 Native Data Operations: Configure IPv4 Address ................................................. 14 Native Data Operations: Operational Show Clock ................................................. 16 Cisco IOS-XR XML Network Management Overview

Cisco IOS-XR XML Network Management lab

Embed Size (px)

Citation preview

Page 1: Cisco IOS-XR XML Network Management lab

1 of 18

© 2010 Cisco Systems, Inc. All rights reserved

LABNMS-2003 Cisco IOS-XR XML Network Management

Table  of  Contents    

Cisco IOS-XR XML Network Management Overview .................................................1  Lab Topology...............................................................................................................2  XML Interface Architecture Overview..........................................................................4  XML Transport Types..................................................................................................5  

TTY XML Agent .......................................................................................................5  XML Dedicated Agent ..............................................................................................6  

XML Schema Objects Overview..................................................................................7  Viewing XML Schema Objects ................................................................................8  XML Schema Definition Files...................................................................................9  XML Schema Objects: Browse Schema Definitions using HTML............................9  XML Schema Objects: On the Router Schema Browser .......................................10  

XML Request and Response Structure.....................................................................12  XML Request Structure .........................................................................................12  XML Response Structure.......................................................................................13  

XML Native Data Operations.....................................................................................13  Native Data Operations: Configure IPv4 Address .................................................14  Native Data Operations: Operational Show Clock.................................................16  

Cisco IOS-XR XML Network Management Overview

Page 2: Cisco IOS-XR XML Network Management lab

2 of 18

© 2010 Cisco Systems, Inc. All rights reserved

Cisco IOS-XR XML Network Management offers a new approach to service provider network management. The Cisco IOS-XR XML on the box infrastructure offers the service provider the capability to provision revenue generating technologies and monitor the network availability. The Cisco IOS-XR XML Network Management offers the advantages of:

Session Oriented Simple XML Request/Response Protocol Supports Router Configuration Provides Access to the router Operational data Authorization of all operations is done via AAA mechanism. Transport options include SSH and Telnet XML Schemas are used for data modeling Takes network management to a new level by removing the need to monitor networks with

CLI scripts. In this lab, we will detail how to use the Cisco IOS-XR XML to configure routers or request information about configuration, management, or operation of the routers. Lab Topology

In this topology:

• A Sun Solaris server is connected using Ethernet to the routers Management Ethernet ports. • Virginia and New York are both GSR 12406 routers. California is a CRS router. • All routers are running Cisco IOS-XR 3.9.0 Release. • The lab server will act as an external client used to manage the network, using IOS-XR XML

Network Management. The Cisco IOS-XR operating system offers highly secure virtualization, integral service delivery, continuous system operation, and multiservice scale. The Cisco XR 12000/CRS Series facilitates the move to Next-Generation IP Networks. The Cisco 12406 Router features 120 Gbps switching capacity in a 6-slot, 10 Gigabit/slot, compact

Page 3: Cisco IOS-XR XML Network Management lab

3 of 18

© 2010 Cisco Systems, Inc. All rights reserved

1/4 rack configuration, delivering a high-speed bandwidth and services for IP/MPLS networks while helping service providers reduce facilities costs. The 12406 chassis is shown next.

The Carrier Routing Systems(CRS-1) is the Industry-leading carrier routing system offering continuous system operation, unprecedented service flexibility, and system longevity Ideal for service providers across all market segments Scales system capacity up to 92 terabits per second (Tbps). In this lab, we are using the Cisco CRS-1 4-Slot Single-Shelf System. This router is the world's most compact 40-Gbps router on the market today. The CRS-1 4-slot router is show next.

Your lab proctor will assign you one of the three routers. In the next sections, we will be establishing a telnet session to your designated router.

Router Management Ethernet Interface Address

Page 4: Cisco IOS-XR XML Network Management lab

4 of 18

© 2010 Cisco Systems, Inc. All rights reserved

Virginia 172.25.1.4

New York 172.25.1.3

California 172.25.1.13

XML Interface Architecture Overview

• On the router, we provide two transport methods that communicate with the outside clients. In this lab, the Solaris server is the external client.

• One transport method is through telnet or SSH server, and the other is through a dedicated for the XML interface.

• We also had CORBA protocol based server here but it has been deprecated since IOS-XR 3.8 Release.

• The XML agent process running receives XML requests from the outside clients through these servers: Telnet, and Dedicated.

• The XML agent then calls ‘XML service library’ to process the received XML requests. • The XML service library first parses the received request by using this XML parser library and

analyzes the requested operation. Then it calls these operations provider libraries depending on the requested operation.

• For example, when Get or Set operations are requested, the MDA (Management Data API) operations provider library will be called.

• When Commit operation is requested, this Config Service operations provider will be called. • The MDA operations provider will access schema database to get definition of the requested

schema including its hierarchy, data type and the corresponding sysdb path. • It will then use SysDB API to get the requested data from the backend components through

SysDB.

Page 5: Cisco IOS-XR XML Network Management lab

5 of 18

© 2010 Cisco Systems, Inc. All rights reserved

• These operations providers will also call backend APIs and get the data or the result of the requested operations.

• Also these libraries build XML response with the obtained data and push it back to XML service library and XML agent will send it back to the outside clients that sent the request.

XML Transport Types TTY XML Agent Now, here’s the brief architecture of, telnet based, TTY XML agent.

• The outside XML clients use telnet connection to send and receive XML messages. • And configuring ‘xml agent tty’ enables this type of XML agent.

Let’s check the TTY XML Agent configuration on the router, then initiate and end an XML session.

• As it is a telnet based agent, you need first to establish a telnet connection to the router in the same way you connect the router for CLI.

• Establish a telnet connection to your designated router. Use the username lab, and password lab. Check the TTY XML Agent is configured on the router.

User Access Verification Username: lab Password: RP/0/RP0/CPU0:ios# show run xml agent tty xml agent tty iteration off ! RP/0/RP0/CPU0:ios#

• Initiating an XML session RP/0/RP0/CPU0:ios# xml echo format XML>

• Ending an XML session

Page 6: Cisco IOS-XR XML Network Management lab

6 of 18

© 2010 Cisco Systems, Inc. All rights reserved

XML> exit RP/0/RP0/CPU0:ios#

• Sending and receiving: How to send an XML request and receive the response is also same

as telnet based agent. You can simply copy and paste your request on the terminal which is in XML mode, and the response will then be displayed on the same terminal.

RP/0/RP0/CPU0:ios# xml echo format XML> <?xml version='1.0' encoding="UTF-8"?> <Request> <Get> <Configuration/> </Get> </Request> <?xml version="1.0" encoding="UTF-8"?> <Response MajorVersion="1" MinorVersion="0"> <Get> <Configuration> <AAA MajorVersion="2" MinorVersion="1"> <AuthorizationTable> <Authorization> <Naming> <Type> exec </Type> <Listname> default </Listname> ………..

XML Dedicated Agent The Dedicated XML Agent listens on a dedicated TCP port (38751). The dedicated XML agent opens a TCP port, 38751, and listens to it waiting for an XML request.

• Establish a telnet connection to your designated router. Use the username lab, and password

lab. Check the XML Agent is configured on the router.

RP/0/RP0/CPU0:ios# show run xml agent xml agent iteration off ! RP/0/RP0/CPU0:ios#

Page 7: Cisco IOS-XR XML Network Management lab

7 of 18

© 2010 Cisco Systems, Inc. All rights reserved

• Initiate an XML Session. Use the username lab and password lab.

networkers-server# telnet <Designated IP Address> 38751 Trying <Designated IP Address>... Connected to <Designated IP Address>. Escape character is '^]'. User Access Verification Username: lab Password: lab XML>

• Ending an XML Session XML> exit Connection closed by foreign host. networkers-server#

• Sending and Receiving. Sending an XML request and receiving the response is same as telnet based agent. You can simply copy and paste your request on the terminal which is in XML mode and the response will then be displayed on the same terminal.

XML> <?xml version='1.0' encoding="UTF-8"?> <Request> <Get> <Configuration/> </Get> </Request> <?xml version="1.0" encoding="UTF-8"?> <ResponseMajorVersion="1"MinorVersion="0"><Get><Configuration><AAAMajorVersion="2" MinorVersion="1"><AuthorizationTable><Authorization><Naming><Type>exec</Type> <Listname>default</Listname></Naming><Methods><Entry>TACACSPlus</Entry> <Entry>Local</Entry></Methods></Authorization></AuthorizationTable></AAA>……

XML Schema Objects Overview

XML objects are organized as a tree structure. Object Types:

Container – objects with child objects Leaf – objects with values Table – objects with naming elements (index key)

Eg: Interface configuration schema structure:

Page 8: Cisco IOS-XR XML Network Management lab

8 of 18

© 2010 Cisco Systems, Inc. All rights reserved

• We sometimes call a schema object a schema class but they are used as a same. • Now, our XML objects are organized as a tree structure. • There are object types according to each object’s hierarchical position and its attribute. • Container object is an object that has child objects and it-self doesn’t have any values. • Leaf object is an object that has values and no child objects. • Table object is an object that has naming elements. • Naming elements are like index keys, it identifies a unique entry in a table. • Table object can be either container or a leaf object. Now this is an example of the structure of interface configuration schema. • The very root object is Configuration, and under it, there is “InterfaceConfigurationTable”

object. • And when the object name has this ‘Table’ suffix then its child object is supposed to be a

table object, which means it has naming elements. • So as InterfaceConfigurationTable has ‘Table’ suffix, its child ‘InterfaceConfiguration’ has

these naming elements. • Also there is always this ‘Naming’ object as a parent of naming elements to indicate these are

naming elements. • In this example, the naming elements are Active, which indicates whether the interface is

active config or preconfigured, and Name, simply a name of the interface to configure, and these can identify a unique interface.

• Now under ‘InterfaceConfiguration’, there is ‘Shutdown’ which is supposed to be have a value ‘true’ when the interface should be shutdown so it is a leaf object.

• And IPV4Network has ‘Address’ child object and then it has ‘Primary’. • And finally, there is ‘IPAddress’ and ‘Mask’ which are to be set with IP address and mask

address. • So these are leaf objects. • Also, InterfaceConfiguration is a table object and it doesn’t have any values but child objects,

so it’s also a container.

Viewing XML Schema Objects Each component or feature has its own schema objects and structure. So how do we know which objects are available for particular feature?

Page 9: Cisco IOS-XR XML Network Management lab

9 of 18

© 2010 Cisco Systems, Inc. All rights reserved

There are following three ways to know available schema objects and structure. • XML schema definition files, or .xsd files and refer them. • Browse the definitions in HTML document using web browser. • Display the available objects on the router using CLI commands.

XML Schema Definition Files XML schemas (.xsd files) define the structure and allowable content of the XML request, response and notification.

• The XML schemas are documented using the standard World Wide Web Consortium (W3C) XML schema language (http://www.w3.org/XML/Schema).

• The XML schemas can be obtained from www.cisco.com.

To view the schema files, any XML viewing/editing applications. The application can display the .xsd files in hierarchical format.

In this lab, we will display the available objects on the router using the CLI commands.

XML Schema Objects: Browse Schema Definitions using HTML The .xsd files can also be converted to an HTML document displaying all the schemas and hierarchies. In the following example, we see an .xsd schemas converted to an HTML document. We are looking at the AAA component. The parent is Configuration, and the Child objects hierarchies follow in HTML format.

Page 10: Cisco IOS-XR XML Network Management lab

10 of 18

© 2010 Cisco Systems, Inc. All rights reserved

XML Schema Objects: On the Router Schema Browser The command line interface ‘show xml schema’ lets you browse XML objects on the router.

• Issue the command ‘show xml schema’ on your designated router. Use the username lab, and password lab.

• You can use ‘list’ or ‘ls’ command to display available schema objects under the current object and use ‘cd’ command to move around the object hierarchy.

Page 11: Cisco IOS-XR XML Network Management lab

11 of 18

© 2010 Cisco Systems, Inc. All rights reserved

RP/0/RP0/CPU0:ios# show xml schema Username:lab Password: Enter 'help' or '?' for help xml-schema[config]:> ls [container] AAA [container] ARP [container] ATM [container] BGP [container] LACP [container] CDP [container] PolicyManager [container] Crypto [container] EIGRP ……….. xml-schema[config]:> cd BGP xml-schema[config]:BGP> ls [container with naming] AS{0} xml-schema[config]:BGP> cd AS{0} xml-schema[config]:BGP.AS> ls [container with naming] FourByteAS{100} xml-schema[config]:BGP.AS>

• The ‘walkdata’ command displays all the available leaf objects and their values as well. xml-schema[config]:> walkdata AAA.AuthorizationTable.Authorization{"exec","default"} Value: Methods: TACACSPlus Methods: Local BGP.AS{0}.FourByteAS{100}.BGPRunning Value: Enable: true BGP.AS{0}.FourByteAS{100}.DefaultVRF.Global.RouterID Value: RouterID: 198.198.198.198 BGP.AS{0}.FourByteAS{100}.DefaultVRF.Global.GlobalAFTable.GlobalAF{IPv4Unicast}.Enabl e Value: Enable: true …………

• The hierarchy command displays the object hierarchy in a graphical way. In this example, we are doing a hierarchy under the BGP component.

Page 12: Cisco IOS-XR XML Network Management lab

12 of 18

© 2010 Cisco Systems, Inc. All rights reserved

xml-schema[config]:BGP> hierarchy BGP | +-AS | +-FourByteAS | +-BGPRunning | +-DefaultVRF | | | +-Global | | | | | +-GlobalAFTable | | | | | | | +-GlobalAF | | | | | | | +-Enable | | | | | | | +-AggregateAddressTable | | | | | | | | | +-AggregateAddress | | | | | | | +-AttributeDownload | | | | | | | +-DisableClientToClientRR …………

XML Request and Response Structure

XML Request Structure

Let’s go over the structure of the XML request:

Page 13: Cisco IOS-XR XML Network Management lab

13 of 18

© 2010 Cisco Systems, Inc. All rights reserved

• In the first line, there is a header. Any requests must start with this header line. • Then, there’s a request tag. It can have the version attributes, but they are optional. • Following the request tag, there is the operation tag. Operation tags are like Get, Set and

Commit. • After the operation tag, there is the namespace tag or options tag. • Namespace tag is expected when requesting schema objects with Get, Set or Delete

operations. • Options tag may be required for some other operations. • After the namespace tag, XML object tags can be specified. • Also, as a standard XML document rule, tags must be ended with close tags with slash like

these in nested format.

XML Response Structure

Let’s go over the structure of the XML response:

• Same as the XML request, there’s a header at the first line, which is followed by Response tag.

• The rest of the structure is pretty much same as the XML request. • If there is an error in processing the request, there will be an error code and message in

operation tag. • There will be also an error code and message in object tag, in which the error was detected.

XML Native Data Operations

• Configuration - Provides access to the router configuration data. - Supports <Get>. <Set> and <Delete> - Get is used to read data from the router - Set is used to configure data on the router - .Delete is used to unconfigure data on the router.

Page 14: Cisco IOS-XR XML Network Management lab

14 of 18

© 2010 Cisco Systems, Inc. All rights reserved

• Operational

- Provides access to the router operational data. Same as show commands CLIs. - Supports Get only.

• Action - Provides access to the action data. e.g clear commands, ping, and traceroute. - Supports only Set.

Native Data Operations: Configure IPv4 Address In this example, we will configure a Loopback interface using Command Line Interface. Then we will read the configured Loopback using an XML Configuration Get Request. Finally, we will change the XML Get response to an XML Configuration Set request, change the IPv4 address, and send the request back to the router.

• Configure a Loopback interface on the router. Use 6500 + station number as the Loopback interface number. Use the station number to complete the IPv4 address. RP/0/RP0/CPU0:ios(config)#interface Loopback(interface number)

RP/0/RP0/CPU0:ios(config-if)#no shut

RP/0/RP0/CPU0:ios(config-if)#ipv4 address 130.130.130.X/32

RP/0/RP0/CPU0:ios(config-if)#commit

RP/0/RP0/CPU0:ios #end

• Make sure the configuration goes through. Capture the Commit ID of the configuration.

RP/0/RP0/CPU0:ios# show configuration commit changes 1000000038 Tue Mar 9 18:05:26.477 UTC Building configuration... !! IOS XR Configuration 3.9.0 interface Loopback6501 ipv4 address 130.130.130.130 255.255.255.255 ! End

• Establish a dedicated XML TTY session.

• Send a Get Configuration request based on the Commit ID captured above. RP/0/RP0/CPU0:ios# xml echo format XML> <?xml version="1.0" encoding="UTF-8"?> <Request> <Get> <Configuration Source="CommitChanges" ForCommitID="1000000038"/> </Get> </Request>

• Let’s look at the XML response in detail.

Page 15: Cisco IOS-XR XML Network Management lab

15 of 18

© 2010 Cisco Systems, Inc. All rights reserved

<?xml version="1.0" encoding="UTF-8"?> <Response MajorVersion="1" MinorVersion="0"> <Get> <Configuration Source="CommitChanges" ForCommitID="1000000038" OperationType="Set"> <InterfaceConfigurationTable MajorVersion="5" MinorVersion="0"> <InterfaceConfiguration> <Naming> <Active> act </Active> <InterfaceName> Loopback6501 </InterfaceName> </Naming> <InterfaceVirtual> true </InterfaceVirtual> <IPV4Network MajorVersion="6" MinorVersion="0"> <Addresses> <Primary> <Address> 130.130.130.130 </Address> <Netmask> 255.255.255.255 </Netmask> </Primary> </Addresses> </IPV4Network> </InterfaceConfiguration> </InterfaceConfigurationTable> </Configuration> </Get> </Response> XML>

• Now to build an XML request to change the Loopback interface IPv4 Address. We can start with the XML Response. We change Get to Set, change the IPv4 address, and add Commit tag after we close Set

‘act’ for active interface

Interface Name

IPv4 address

Page 16: Cisco IOS-XR XML Network Management lab

16 of 18

© 2010 Cisco Systems, Inc. All rights reserved

<?xml version="1.0" encoding="UTF-8"?> <Request MajorVersion="1" MinorVersion="0"> <Set> <Configuration> <InterfaceConfigurationTable MajorVersion="5" MinorVersion="0"> <InterfaceConfiguration> <Naming> <Active> act </Active> <InterfaceName> Loopback6501 </InterfaceName> </Naming> <InterfaceVirtual> true </InterfaceVirtual> <IPV4Network MajorVersion="6" MinorVersion="0"> <Addresses> <Primary> <Address> 130.130.130.131 </Address> <Netmask> 255.255.255.255 </Netmask> </Primary> </Addresses> </IPV4Network> </InterfaceConfiguration> </InterfaceConfigurationTable> </Configuration> </Set> <Commit/> </Request>

• We know the request was successful when we get a commit ID in the response.

<?xml version="1.0" encoding="UTF-8"?> <Response MajorVersion="1" MinorVersion="0"> <Set> <Configuration/> </Set> <Commit CommitID="1000000039"/> </Response> XML>

Native Data Operations: Operational Show Clock

• Establish a TTY XML session and send the show clock request. The response will return same fields and values as show clock CLI command.

‘act’ for active interface

Interface Name

IPv4 address

Page 17: Cisco IOS-XR XML Network Management lab

17 of 18

© 2010 Cisco Systems, Inc. All rights reserved

RP/0/RP0/CPU0:ios#xml echo format XML> <?xml version="1.0" encoding="UTF-8"?> <Request> <Get> <Operational> <SystemTime> <Clock/> </SystemTime> </Operational> </Get> </Request> <?xml version="1.0" encoding="UTF-8"?> <Response MajorVersion="1" MinorVersion="0"> <Get> <Operational> <SystemTime MajorVersion="1" MinorVersion="0"> <Clock> <Year> 2010 </Year> <Month> 3 </Month> <Day> 10 </Day> <Hour> 1 </Hour> <Minute> 25 </Minute> <Second> 55 </Second> <Millisecond> 760 </Millisecond> <TimeZone> UTC </TimeZone> <TimeSource> Calendar </TimeSource> </Clock> </SystemTime> </Operational> </Get> </Response> XML>

• The XML response can also be translated to HTML using XSLT as shown below.

Page 18: Cisco IOS-XR XML Network Management lab

18 of 18

© 2010 Cisco Systems, Inc. All rights reserved