Placeholder

LinTTP: An OpenFlow Table Type Pattern (TTP) Validator and Linter

Free!

LinTTP is a validator and linter for OpenFlow Table Type Patterns (TTP). LinTTP is still in early stages, but is functional. It currently finds several errors in the example TTP file provided in the specification itself with references to section and page numbers in the specification where the restrictions are defined. See the included README.md file for more information.

linttp-0.1.2.tar.gz

Login for download
SKU: linttp-0.1.2

Product Description

LinTTP is a validator and linter for OpenFlow Table Type Patterns (TTP). See the article introducing LinTTP and why it is needed. LinTTP is still in early stages, but is functional. It currently finds several errors in the example TTP file provided in the specification itself with references to section and page numbers in the specification where the restrictions are defined. See the included README.md file for more information. An HTML rendering of it is provided here:

LinTTP

An OpenFlow Table Type Pattern (TTP) validator and linter.

Installation

Install a recent version of Node.js for your platform, then use npm to install from provided archive:

Installing linttp globally may require sudo privileges. Follow the instructions provided by npm if the command fails.

Validating a TTP

Currently, only basic validation is implemented and that validation is currently in the form of validating the TTP JSON file against a generated JSON-Schema with tv4 as the validator. To validate, run the following command:

The output will will contain the original message from tv4 along with a description pointing to the location in the TTP specification where the rule is defined. For example, in the 1.0 version of the TTP specification itself, there is an included example TTP. Running this tool against it provides the following output:

Validation Output Breakdown

The first number (such as 102, 302, and 0 above) refer to the error number provided by the JSON-Schema validator, followed by the path in the JSON file checked where the error was found. Next is the description of the error followed by the path in the JSON-Schema that defined the rule. If a description is available inside the generated schema, that description is also logged on the next line.

For example, the first error is:

The error number is 102 and occurred while validating the path /flow_tables/0/built_in_flow_mods/1/priority. The error description from the JSON-Schema validator is “Value 0 is equal to exclusive minimum 0”. The location in the schema that prompted this validation failure is at the path . Finally, the description in the generated schema points to why this rule applies and the page number in the TTPv1 specification PDF where it can be referenced.

For clarity, here is the definition of referenced Built-in Flow Mod:

And the portion of the generated schema that caused this flow mod to fail validation:

The specification description references section 3.6.1 on page 23, which states:

The priority and priority_rank specify the valid priority values for the flow_mod type. The value of a priority member is an integer greater than zero, or an integer range of the form "n..m" where n and m are integers with 0 < n < m.

By that text, it seems that a priority should never be zero because it is specified to always be greater than, but not equal to, zero.

JSON-Schema

LinTTP generates a JSON-Schema to validate most of the low level data format requirements. To export the generated schema, run the following:

Please note that this file may be several megabytes in size. The output size is currently limited by LinTTP’s ability to resolve JSON path references directly to provide the extra description that points to the TTP specification through a JSON-Schema $ref reference. LinTTP plans on removing this limitation so $ref references can be used instead of copying the same schema data used in meta-member definitions. In either case, to understand how the schema is produced, look at the lib/schema.coffee file. For the example in the previous section, that schema was generated from the following code:

 

Roadmap

LinTTP is planned to be expanded to allow further validation and also linting of TTP files as more real-world use cases emerge for this technology. There are several TTP example files, including one published by Broadcom for their line of OF-DPA 2.0 compatible hardware. Unfortunately, that TTP file at the time this software was written (v2.0.0.2) was very non-compliant in many ways. LinTTP was written as a way for the author to understand how important information could be extracted from current TTP files and also to demonstrate the need for TTP validation for it to succeed in real-world use.

For more information on OF-DPA 2.0, its use cases and experiences from the author, please visit OF-DPA Insider at http://ofdpa.com/.

Reviews

There are no reviews yet.

Be the first to review “LinTTP: An OpenFlow Table Type Pattern (TTP) Validator and Linter”


*

Install a recent version of Node.js for your platform, then use the npm command to install from the provided archive. On a Mac of Linux system, this will look something like this:

$ npm install -g linttp-0.1.2.tar.gz
linttp@0.1.2
├── tv4@1.2.7
├── coffee-script@1.10.0
├── nopt@3.0.6 (abbrev@1.0.7)
└── lodash@4.0.0

Refer to the npm documentation on installing packages on other platforms. Once installed, the linttp command should be available on the shell’s path. To verify it is installed, run linttp. This should show information on using the command:

$ linttp
Usage: linttp [options]

Options:
  -p, --printSchema   Print the JSON-Schema generated and used for checking
  -c, --check         Check a file against the TTP schema
  -r, --raw           Print raw error information from the validation engine
  -u, --unknownProps  (tv4) Ban unknown properties
  -v, --version       Display version information

Example:
  linttp -c example.ttp.json