XML-based Network Management Rob Enns [email protected].

21
XML-based Network Management Rob Enns [email protected]

Transcript of XML-based Network Management Rob Enns [email protected].

Page 1: XML-based Network Management Rob Enns rpe@juniper.net.

XML-based Network Management

Rob [email protected]

Page 2: XML-based Network Management Rob Enns rpe@juniper.net.

Introduction

Routers are complex devices that are hard to manage remotely Traditional management methods are SNMP and

expect, their strengths and weaknesses are well-known

Operators and network management software vendors demand a secure, stable method to manage routers

Want network-oriented solutions, not single-box ones

XML is an alternative with exciting possibilities

Page 3: XML-based Network Management Rob Enns rpe@juniper.net.

XML

Extensible Markup Language XML is a generally self-describing data format

Application reads data, parses it, and knows exactly what each constituent part of the data means

An XML document is a “text file with structure” Easy to understand Easy to parse Easy to debug

Widely implemented standard http://www.w3c.org/xml

Page 4: XML-based Network Management Rob Enns rpe@juniper.net.

Why XML?

Network devices are good at generating large amounts of hierarchical data Device configurations Routing tables Interface hierarchies Billing records

XML is good at describing hierarchical data in a standard way

Page 5: XML-based Network Management Rob Enns rpe@juniper.net.

XML Elements

Six main constructs Open tags: <tag> Close tags: </tag> Data: <tag>data</tag> Empty tags: <tag/> Attributes: <tag foo=“bar” goo=“gar”/> Namespaces:

<home> <address>123 Main Street</address> <network xmlns:ns2=“my.identifying.string”> <ns2:address>10.0.0.1</ns2:address> </network></home>

Page 6: XML-based Network Management Rob Enns rpe@juniper.net.

<?xml version="1.0" encoding="UTF-8"?> <route> <destination>10.3.1.1/32</destination> <route-entry> <current-active/> <protocol-name>BGP</protocol-name> <preference>170</preference> <age seconds="1749">00:29:09</age> <local-preference>100</local-preference> <learned-from>10.17.136.2</learned-from> <as-path>1403 170 39 I</as-path> <nh> <selected-next-hop/> <to>192.168.1.254</to> <via>ge-0/0/0.0</via> </nh> </route-entry> </route>

XML Example

Page 7: XML-based Network Management Rob Enns rpe@juniper.net.

Advantages of XML

Handles forward and backward compatibility

Widely available toolsWidely implemented standard

http://www.w3c.org/xml

Page 8: XML-based Network Management Rob Enns rpe@juniper.net.

DTDs and XML Schemas

XML data definition tools Document Type Definitions (DTDs)

Lists the elements that may appear in an XML document and their relationships to one another

XML Schemas Defines content and semantics in addition to element

relationships Simple and complex data types, value ranges, match

expressions, documentation

Page 9: XML-based Network Management Rob Enns rpe@juniper.net.

XSL

XML Stylesheet Language Originally intended for rendering XML Powerful enough for generic transformations Two branches of the technology

XSLT – XSL Transformations XML->XML transformations Add additional information Remove uninteresting elements or attributes Rearrange hierarchies, sort elements, lots of party

tricks XSL-FO – XSL Formating Objects

Render XML into XHTML or PDF

Page 10: XML-based Network Management Rob Enns rpe@juniper.net.

XSL Functionality

XSLTProcessor

XSLTStylesheet

XMLInput

Document

XMLOutput

Document

XSLT can make: XML, XHTML, Text, SVG, XSLT

<TD>MTU: 1500</TD>

<mtu>1500</mtu>

<TD>MTU: <xsl:value-of=“.”/></TD>

Page 11: XML-based Network Management Rob Enns rpe@juniper.net.

XPath A standard for describing parts of XML

documents Uses “Unix-like” path expressions Basic expression and function support Used by XSL Select the serial number of every chassis

component /chassis-inventory/chassis/chassis-module/serial-number

Select every chassis component with a temperature attribute greater than 40 degrees chassis-module[@temperature &gt; 40]

Get the status of power supply B chassis-module[name="Power Supply B"]/status

Page 12: XML-based Network Management Rob Enns rpe@juniper.net.

Using XML for Network Management

Network Monitoring Device Configuration Network Provisioning Fault diagnosis

Page 13: XML-based Network Management Rob Enns rpe@juniper.net.

Network Monitoring

Applications periodically fetch operational content

Compare against historical data using XML diff tools, or transform data into a more appropriate format using XSLT

Use XSL to render output Web page (XSLT) Email (XSLT) Report PDF (XSL-FO)

Example: Collecting hardware inventory

Page 14: XML-based Network Management Rob Enns rpe@juniper.net.

Hardware Inventory

Inventory DB

Router A

Router Z

. . . . . .

.

Retrieve inventory data from network

Transform data into format required by inventory DB

Add data to inventory DB

XSL Transformation

Page 15: XML-based Network Management Rob Enns rpe@juniper.net.

Device Configuration

Configuration is exposed in XML elements For example:

<configuration> <protocols> <bgp> <group> <name>local</name> <neighbor> <name>10.0.0.1</name> <local-address>10.0.0.2</local-address> </neighbor> </group> </bgp> </protocols></configuration>

Page 16: XML-based Network Management Rob Enns rpe@juniper.net.

Device Configuration

Represent device configurations in XML

Configurations become malleable data, can be manipulated using standard tools Add/delete/change configuration using

XSL transformations Store and retrieve configuration from an

XML database

Page 17: XML-based Network Management Rob Enns rpe@juniper.net.

Network Provisioning

Avoid writing multiple vendor-specific configuration parsers

Use XSLT to translate from vendor-neutral configuration to a vendor-specific configuration for each device

XML Schemas can provide data types, value ranges, regex matches, help information for vendor configuration Enables provisioning tools to partially validate

configuration before uploading to device

Page 18: XML-based Network Management Rob Enns rpe@juniper.net.

Network Provisioning

Router(s)

Customer DB

Interface DB

Policy DB

XSL Transformatio

n

Device-specific

Configuration

Vendor-independent configuration

Page 19: XML-based Network Management Rob Enns rpe@juniper.net.

Diagnosing Faults

Everyone has “5 commands” to run when logging on to a sick router

Diagnose problems with network by running XSL scripts over XML output XSL is a powerful tool Inspect results from multiple commands Discard normal output Focus on abnormal situations Use SVG (Scalable Vector Graphics (XML)) to

graph historical values for data visualization Target multiple routers

Page 20: XML-based Network Management Rob Enns rpe@juniper.net.

Summary

Choosing XML simplifies application development Widely available tools and information Easy to understand text format Larger talent pool of engineers

Offers a reliable alternative to Expect scripts XML’s self-describing nature prevents problems

with variations in CLI output Enhances Interoperability

XML is a standard method of exchanging information between programs

Adopted by many industries – eCommerce, databases, networking, etc.

Page 21: XML-based Network Management Rob Enns rpe@juniper.net.

http://www.juniper.net

Thank you!