# openflow-schema

**What:** OpenFlow schema (versions 1.0 and 1.3)

**Why:** Provides resource for message checking, instantiation, and even documentation for OpenFlow messages.

> [!WARNING]
> I made this as part of a research project back in 2015-2016. The tooling and versions used here reflect the era. OpenFlow 1.4 and 1.5 are not covered.


## Installation

**Build:** `npm install` 

This will build dependencies and generate the `lib` directory with JSON schema from the YAML `src` (this executes `build.js` as prepublish step).

**Test:** `npm test`


## Usage

**Import the schema:**

```js
const {of13} = require('@dancasey/openflow-schema')
```


For more thorough examples: 

- See my [`node-openflow`](https://github.com/dancasey/node-openflow) library that utilizes this schema 
- See my [`rxdn`](https://github.com/dancasey/rxdn) SDN controller.
- Read Chapter IV [here](https://apps.dtic.mil/sti/trecms/pdf/AD1055983.pdf).


## References

- OpenFlow switch specification and corresponding `openflow.h` from [Open Networking Foundation (ONF)](https://www.opennetworking.org/sdn-resources/technical-library)
- [JSON Schema](http://json-schema.org)
- Understanding JSON Schema by [Space Telescope Science Institute](https://spacetelescope.github.io/understanding-json-schema/index.html)
- [yaml.org](http://yaml.org)
- [js-yaml](http://nodeca.github.io/js-yaml/)
