Introduction to pxGrid 2.0

The platform now operates using the REST and Websocket protocols. While legacy XMPP implementations will still be supported, we highly encourage partners to switch their pxGrid client implementations to these new protocols. There are a ton of benefits in doing so!

Why Make the Switch?

Before we discuss the advantages of switching to REST and Websocket, let’s highlight some of the pain points faced by pxGrid client developers today. The original pxGrid server implemented the Extensible Messaging and Presence Protocol (XMPP). While originally very popular, this protocol suffered from numerous shortcomings when it came to application-to-application messaging. For example, the publish-subscribe model (pubsub) required modification of all XML messages which was very costly for both servers and clients. The popular server-side implementation of XMPP, XCP server, assumed all messages would be chat-like. However, application messages are often very different. Some communications require large amounts of data to be streamed quickly over a long period of time. In XMPP, such messages would have to be constructed completely before being sent over. This imposed large memory requirements for both clients and servers. To circumvent this in pxGrid, an out-of-band mechanism was introduced using REST, but this created dissonance in pxGrid services. XMPP also required the use of a client SDK with many unsupported libraries and scant documentation. The SDK also limited developers to use only the Java or C programming languages and also required a rather steep learning curve. In summary:

  • XMPP required heavy XML processing

  • XCP-server was not built with application-to-application communication in mind

  • pxGrid clients were required to use two ports for in-band and out-of-band queries

  • Developers were required to integrate a rather large client SDK

This is where the REST and Websocket come in to save the day. Both are simple, heavily-supported, and industry-standards for application-to-application communications. Websocket provides quick and scalable bi-directional data transfer (you can read more about it here), while REST provides quick extensible querying mechanisms – all over the same interface. pxGrid utilizes Websocket for pubsub components while all one-shot queries (for both control and service data) is done via REST. Furthermore, all message bodies are far simpler and formatted in JSON.

With these new protocols also comes freedom of speech for developers. We are no longer confined to just the Java and C programming languages. By leveraging any standard REST and Websocket libraries, pxGrid clients can now be coded in almost any language including Python and Golang. You can find our sample implementations here, but we encourage you to continue on in this document before diving into them. Here are some open-source libraries for REST and Websocket that we have found useful: aiohttp (Python), Tyrus (Java), and Gorilla (Golang).

Benchmarks

Websocket also vastly enhances pxGrid’s performance and scaling capabilities. Previously, only 20,000 kilobytes of messages per second (KB/s) were supported by a pxGrid server with one active subscriber. As more subscribers are added, this number dwindles: two subscribers -> 10,000 KB/s, four subscribers -> 5,000 KB/s, etc. With Websocket, we can handle much much more and have multiple pxGrid servers actively supporting clients at the same time. Each server can now serve 150 simultaneous clients at a combined rate of 100,000 KB/s. In ISE 2.3, two active pxGrid servers will be recommended. We plan to add infrastructure for more in the future.

Getting Started

If you feel you are ready to get started, proceeed to download the ISE iso image and the How-To Guide, please see Getting Started

Accessing pxGrid 2.0 Resources

pxGrid 2.0 How-to Guide

Explains pxGrid 2.0 operation and provides JAVA Source Code example. pxGrid Context-In is also included.

Download Sample Code in JAVA

Illustrates how to download and import sample code from https://github.com/cisco-pxgrid/pxgrid-rest-ws into Ecllipse

List of JAVA examples

Contains complete code examples for https://github.com/cisco-pxgrid/pxgrid-rest-ws/wiki

Parity Chart bewtween pxGrid 1.0 and pxGrid 2.0

Contains a comprehensive list of new and old services and their support in ISE 2.3 and ISE 2.4

Techinical Overview

Describes Cisco's implementation of pxGrid 2.0

Using Pre-Shared Keys

Username and Password is an alternative to using certificates. In your implementation you may still want to include certificates and provide the option of using both.

pxGrid Context-IN

Discusses pxGrid Context-in and provides examples of both Internet of Things (IOT) Solution Vendor and Security Soluton vendor, both publishing IOT asset information and threat information to ISE.

Dynamic Topics

Dicusses Dynamic Topic operation and provides an example of a pxGrid client, publishing a custom topic to a Consumer, pxGrid client, susbcribing to the custom topic and receiving the information.

Videos

Coming soon