Building a Software-Defined Networking Tapping Application

Veteran software architect explains how he developed an educational SDN app.

With spotty documentation available for building software-defined networking (SDN) apps using technology such as OpenDaylight and OpenFlow, veteran software architect Andy Pearce has detailed the process to provide an educational tool for others to learn from.

Pearce was commissioned by the Open Networking Foundation (OFN) to build an SDN network tapping application and document his experience as an instructional resource. Such applications monitor and collect network traffic to improve aspects such as performance and security. The resultant SampleTap application is available on GitHub.

With extensive C++ and C experience, Pearce nevertheless found many challenges and sometimes needed help from experts in the field in tackling the Java-based project, as he documented in a webinar produced by ONF and SDNCentral, and an ongoing four-part blog series on the ONF site.

After explaining how the project came about and how it was designed, Pearce yesterday posted part three of his series, with a closer examination of the development process.

"When we built the network tapping app, we had a primary use case in mind," said Pearce, who works for Wiretap Labs. "We envisioned an administrator looking to apply tap-aggregation to [top-of-rack] ToR or access switches that handle normal traffic through the network. This administrator could use a Web UI to configure the tap-aggregation switch to capture a subset of this traffic for further processing and analysis."

The UML diagram alone speaks to the complexity of the project
[Click on image for larger view.] The SampleTap use cases
(source: ONF/SDNCentral webinar)

Not being a UI expert, Pearce brought in a specialist in JavaScript, HTML 5 and Ruby to build the front end, a Web UI.

Before actually starting to code the guts of the app, much preliminary work was required, Pearce said, such as: defining requirements in a text document; researching OpenFlow and building sample apps with that technology; specifying key components and documenting a system block diagram; translating user requirements into a domain object model and documenting that with a UML diagram; and working with the UI specialist to define and document the UI APIs and related functionality.

The SampleTap UML diagram
[Click on image for larger view.] The SampleTap UML diagram
(source: ONF GitHub depository)

OpenFlow is a communications protocol essential to certain approaches to SDN, a relatively new technology with varying viewpoints -- some vendor-specific -- about how it should be implemented. OpenFlow "gives access to the forwarding plane of a network switch or router over the network" and "enables remote controllers to determine the path of network packets through the network of switches" according to a Wikipedia entry. An ONF tutorial describes OpenFlow as "an open interface for remotely controlling the forwarding tables in network switches, routers and access points."

Another crucial technology was the open-source OpenDaylight project hosted by the Linux Foundation to help the industry move to SDN by providing "an open platform for network programmability to enable SDN and create a solid foundation for [network functions virtualization] NFV for networks at any size and scale." SampleTap runs on an OpenDaylight controller.

After the aforementioned preliminary work and the implementation and testing of mid-tier logic and UI APIs, followed by integrating and testing the UI with the middle tier and the back-end MongoDB database, Pearce converted the app to an Open Service Gateway initiative (OSGi) bundle and integrated that with the OpenDaylight framework. OSGi is a modular platform that provides a dynamic component model for Java.

The UML diagram alone speaks to the complexity of the project
[Click on image for larger view.] The SampleTap object model
(source: ONF/SDNCentral webinar)

Further steps in the development process consisted of subscribing to OpenDaylight services and testing with switch connect and disconnect events, implementing application logic for traversing database objects, and generating flow rules from user configurations.

Then it was time for full testing and fixing the bugs found, before adding the final functionality. The last development step involved adding APIs to view logs and statistics and to finalize the Web UI views.

Yet more work to be done involved configuring the app to support the aforementioned use case of applying tap-aggregation to switches and configuring them to capture traffic for processing and analysis.

Although available for educational purposes on GitHub, Pearce and the ONF emphasized the finalized SampleTap app was not intended to be a production-ready tool.

"Designed as a teaching tool for programmers looking to gain experience with OpenFlow and OpenDaylight, the application is not meant to serve as a commercial tapping product," the ONF said in a statement. The ONF said member companies "offer or plan to offer commercial-grade network tapping products" and recommended contacting one of those vendors if interested in obtaining such an app.

Nevertheless, Pearce said the application source code is available under an Apache 2.0 license and can be freely downloaded by developers wanting to explore or improve on it.

"We can imagine a number of enhancements that might be added to the tapping application later," Pearce wrote in his latest blog post. "For example, in the future, the app could be extended to support high availability and improved scalability. We could also add usability features that would make it easier and more convenient to define the set of flows to tap and capture, such as predefining common protocol numbers, or Ethernet header types."

In his next and final post, Pearce said, he will go into more detail about lessons learned in integrating the app with OpenDaylight and OSGi.

About the Author

David Ramel is an editor and writer at Converge 360.

Featured

Subscribe on YouTube