Skip to content

Commit

Permalink
Fixed links to API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-riecke committed Mar 10, 2016
1 parent 33535ea commit f26f399
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 130 deletions.
13 changes: 9 additions & 4 deletions Conclusion/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ developed in OCaml. You saw how to use it to analyze packets on
an SDN controller, install rules in the data plane and monitor traffic
statistics.

- *NetKAt* is a high-level domain-specific language for specifying SDN
- *NetKAT* is a high-level domain-specific language for specifying SDN
policies. In just a few, simple lines of code, you could specify forwarding
policy and queries for multi-switch networks in a modular, compositional
fashion. The Frenetic compiler (built using Ox, of course) compiled your
Expand All @@ -21,10 +21,15 @@ the data plane.
Still, there's a lot more to the Frenetic environment than what you
have seen in this tutorial. One way to get started finding out more is
to dig further in to the code. For instance, you might look at
[NetCoreLib](https://github.com/frenetic-lang/frenetic/tree/master/lib), which is the primary library that implements FreneticDSL. Take a look at the internal syntax of Frenetic in the [NetCoreTypes Module](https://github.com/frenetic-lang/frenetic/blob/master/lib/NetCore_Types.mli) and then move on to other libraries, including those that implement [Mac Learning](https://github.com/frenetic-lang/frenetic/blob/master/lib/NetCore_MacLearning.mli) and
[Nat](https://github.com/frenetic-lang/frenetic/blob/master/lib/NetCore_NAT.ml). The latter components will introduce you to the basics of
[Frenetic_NetKAT](http://frenetic-lang.github.io/frenetic/Frenetic_NetKAT.html),
which is the primary library that implements NetKAT. Take a look at the internal syntax of Frenetic in the
[Compiler Module](http://frenetic-lang.github.io/frenetic/Frenetic_NetKAT_Compiler.html)
and then move on to other libraries, including those that implement
[Mac Learning](https://github.com/frenetic-lang/frenetic/blob/master/examples/Learning_Switch.ml). The
latter components will introduce you to the basics of
how to construct your own dynamic policies in the Frenetic programming
environment using NetCoreLib combined with OCaml's [Lwt Threading Libraries](http://ocsigen.org/lwt/manual).
environment using NetCoreLib combined with OCaml's
[Async library](https://realworldocaml.org/v1/en/html/concurrent-programming-with-async.html).

Have fun!

Expand Down
6 changes: 3 additions & 3 deletions Introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ References
This webpage describes Mininet, a system we will use to run
controllers on a simulated network of switches.

- [OCaml APIs](http://frenetic-lang.github.io/api)
- [Frenetic OCaml APIs](http://frenetic-lang.github.io/frenetic/index.html)

This web page provides documentation for the
[Ox](http://freneti-lang.github.io/api/ox) and
[NetKAT](http://frenetic-lang.github.io/api/frenetic) libraries, as
[Ox](https://github.com/frenetic-lang/frenetic/blob/master/async/Frenetic_Ox.mli) and
[NetKAT](http://frenetic-lang.github.io/frenetic/Frenetic_NetKAT.html) libraries, as
well as other supporting libraries used in this tutorial.

146 changes: 74 additions & 72 deletions NetKATManual/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
---
layout: main
title: Frenetic Tutorial
title: NetKAT Manual
---

NetCore Manual
==============
The NetKAT Manual is intended as a lightweight reference to the syntax of the
NetKAT domain-specific language.

The NetCore Manual is intended as a lightweight reference to the syntax of the
NetCore domain-specific language (NetCoreDSL). More detailed documentation can
be found in the [NetCore tutorial](06-Frenetic-Introduction).


NetCore Syntax
NetKAT Syntax
--------------

Types:
Expand All @@ -21,92 +17,98 @@ Types:
<mac-address> ::= xx:xx:xx:xx:xx:xx
<ip-address> ::= xxx.xxx.xxx.xxx
<mask> = 1 ... 32
<masked-ip-address> ::= <ip-address> / <mask>
<switch-id> ::= 64-bit integer
<port-id> ::= 16-bit integer
<vport-id> ::= 64-bit integer
<vfrabric-id> ::= 64-bit integer
<vlan-id> ::= none | 12-bit integer
<tcp-port> ::= 16-bit integer
<vlan-pcp> ::= 16-bit integer
<frame-type> ::= arp (* shorthand for 0x806 *)
| ip (* shorthand for 0x800 *)
| 8-bit integer
<ip-protocol> ::= icmp (* shorthand for 0x01 *)
| tcp (* shorthand for 0x06 *)
| udp (* shorthand for 0x11 *)
| 8-bit integer
<seconds> ::= [0-9]+ | [0-9]+ . [0-9]+
<string> ::= '"' [^ '"']* '"'
<location> ::= <switch-id> @ <port-id>
```

Predicates:

```
<apred> ::= ( <pred> )
| ! <apred>
| *
| <none>
| switch = <switch-id>
| inPort = <port-id>
| dlSrc = <mac-address>
| dlDst = <mac-address>
| vlan = <vlan-id>
| srcIP = <ip-address>
| dstIP = <ip-address>
| nwProto = <ip-protocol>
| tcpSrcPort = <tcp-port>
| tcpDstPort = <tcp-port>
| dlTyp = <frame-type>
<orpred> ::= <apred>
| <apred> || <orpred>
<pred> ::= <orpred>
| <orpred> && <pred>
<pred-atom> ::= ( <pred> )
| true
| false
| switch = <switch-id>
| port = <port-id>
| vswitch = <switch-id>
| vport = <vport-id>
| vfabric = <vfabric-id>
| vlan = <vlan-id>
| vlanPcp = <vlan-pcp>
| ethTyp = <frame-type>
| ipProto = <ip-protocol>
| tcpSrcPort = <tcp-port>
| tcpDstPort = <tcp-port>
| ethSrc = <mac-address>
| ethDst = <mac-address>
| ip4Src = <masked-ip-address> | <ip-address>
| ip4Dst = <masked-ip-address> | <ip-address>
<not-pred> ::= <pred-atom>
| not <not-pred>
<and-pred> ::= <not-pred>
| <and-pred> and <not-pred>
<or-pred> ::= <and-pred>
| <or-pred> or <and-pred>
<pred> ::= <or-pred>
```

Policies:

```
<id> ::= [A-Z a-z _] [A-Z a-z _ 0-9]*
<module> ::= learn ( )
| nat ( publicIP = <ip-addr> )
<apol> ::= ( <pol> )
| <id>
| filter <pred>
| <port-id> (* Forward out port <port-id>. *)
| pass
| drop
| all (* Forward out all ports. *)
| dlSrc <mac-address> -> <mac-address>
| dlDst <mac-address> -> <mac-address>
| vlan <vlan-id> -> <vlan-id>
| srcIP <ip-address> -> <ip-address>
| dstIP <ip-address> -> <ip-address>
| tcpSrcPort <tcp-port> -> <tcp-port>
| tcpDstPort <tcp-port> -> <tcp-port>
| monitorPackets ( <string> )
| monitorPolicy ( <pol> )
| monitorTable ( <switch-id> , <pol> )
| monitorLoad (<seconds>, <string>) (* Print the number of packets *)
(* and bytes processed by this *)
(* policy in the last <seconds>.*)
(* Label output using <string>. *)
<cpol> ::= <apol>
| if <pred> then <cpol> else <cpol>
<seq_pol_list> ::= <cpol>
| <cpol> ; <seq_pol_list>
<par_pol_list> ::= <cpol>
| <cpol> + <par_pol_list>
<pol> ::= <cpol>
| <cpol> ; <seq_pol_list>
| <cpol> + <par_pol_list>
| let <id_1>, ... <id_n> = <module>(<arg_1> ,... , <arg_m>)
<pol-atom> ::= ( <pol> )
| id
| drop
| filter <pred>
| switch := <switch-id>
| port := <port-id>
| vswitch := <switch-id>
| vport := <vport-id>
| vfabric := <vfabric-id>
| vlan := <vlan-id>
| vlanPcp := <vlan-pcp>
| ethTyp := <frame-type>
| ipProto := <ip-protocol>
| tcpSrcPort := <tcp-port>
| tcpDstPort := <tcp-port>
| ethSrc := <mac-address>
| ethDst := <mac-address>
| ip4Src := <ip-address>
| ip4Dst := <ip-address>
| <location> => <location>
| <location> =>> <location>
<star-pol> ::= <pol-atom>
| <star-pol> *
<seq-pol> ::= <star-pol>
| <seq-pol> ; <star-pol>
<union-pol> ::= <seq-pol>
| <union-pol> + <seq-pol>
<cond-pol> ::= <union-pol>
| if <pred> then <cond-pol> else <cond-pol>
<pol> ::= <cond-pol>
<program> ::= <pol>
```
4 changes: 4 additions & 0 deletions NetKATRepeater/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ let _ =
never_returns (Scheduler.go ());
~~~

### NetKAT Reference Manual

The complete NetKAT language is described [here](../NetKATManual).
14 changes: 1 addition & 13 deletions OxMonitor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,6 @@ Consider what happens if the controller receives HTTP packets before
the switch is fully initialized and extend your monitoring program to
handle this situation.

[statistics]: https://github.com/frenetic-lang/frenetic/blob/master/lib/OpenFlow0x01.mli

[Action]: http://frenetic-lang.github.io/frenetic/docs/OpenFlow0x01.Action.html

[PacketIn]: http://frenetic-lang.github.io/frenetic/docs/OpenFlow0x01.PacketIn.html

[PacketOut]: http://frenetic-lang.github.io/frenetic/docs/OpenFlow0x01.PacketOut.html

[Ox Platform]: http://frenetic-lang.github.io/frenetic/docs/Ox_Controller.OxPlatform.html

[Match]: http://frenetic-lang.github.io/frenetic/docs/OpenFlow0x01.Match.html

[Packet]: http://frenetic-lang.github.io/frenetic/docs/Packet.html
[statistics]: http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#TYPEstatsReq

{% include api.md %}
16 changes: 0 additions & 16 deletions Tutorial-Notes.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
* Add instructions on how to reset the VM and Mininet when things shutdown unexpectedly.

* For [Firewall Chapter](https://github.com/frenetic-lang/frenetic/wiki/03-OxFirewall) and [Learning Chapter](https://github.com/frenetic-lang/frenetic/wiki/05-OxLearning) , wrong type for `switch_connected`. (SwitchFeatures.t argument is missing after the Core.switchId argument)

* For [Monitor Chapter](https://github.com/frenetic-lang/frenetic/wiki/04-OxMonitor) consider adding sample test results after Programming Exercises 1 and 2 (unless we are expected get the same results as the first traffic monitoring Programming Task, then state that)

* For [Learning Chapter](https://github.com/frenetic-lang/frenetic/wiki/05-OxLearning), add sample test results for the Efficient Learning Switch. Is the `switch_connected` function needed?

* There are two Chapter 7's and two Chapter 8's. The [NetCore Composition Chapter](https://github.com/frenetic-lang/frenetic/wiki/07-NetCoreComposition) contains repeated information from the [NCMonitoring Chapter](https://github.com/frenetic-lang/frenetic/wiki/09-NCMonitoring) (one diagram doesn't appear in the monitoring chapter)

* Update links on [WrapUp Chapter](https://github.com/frenetic-lang/frenetic/wiki/10-WrapUp)

* The [Using Frenetic from OCaml](https://github.com/frenetic-lang/frenetic/wiki/Using-Frenetic-from-OCaml) page is unfinished. (There is no tutorial)

* For the [NCFirewall Chapter](https://github.com/frenetic-lang/frenetic/wiki/07-NCFirewall), when running fortune on `h1`, `h3` and `h4` timeout when running curl. Is this expected behavior? When running fortune on `h3`, `h4` times out when running curl instead of connecting.

* In the [NetCore Composition Chapter](https://github.com/frenetic-lang/frenetic/wiki/07-NetCoreComposition), specify where Port_Map.nc and other example code can be found (`~/src/frenetic/examples/`)

* API Pages referenced throughout do not currently work.

* The three line starter for Ox applications may not be necessary. It may be as simple as doing
module Controller = OxStart.Make (MyApplication)

* Need to find some place for the netkat tutorial workspace and solutions.

* NetKAT Manual, though in the index, should be indexed, formatted and checked for accuracy
3 changes: 3 additions & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
- name: Routing with NetKAT
path: ../NetKATRouting
group: frenetic
- name: NetKAT Manual
path: ../NetKATManual
group: frenetic
- name: Conclusion
path: ../Conclusion
group: frenetic
35 changes: 15 additions & 20 deletions _includes/api.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
[OpenFlow_Core]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01_Core
#### API Reference

[send_stats_request]: https://github.com/frenetic-lang/ox/blob/master/lib/OxPlatform.mli#VALsend_stats_request
[OpenFlow_Core](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html)

[header accessor functions]: https://github.com/frenetic-lang/ocaml-packet/blob/master/lib/Packet.mli
[send_stats_request](https://github.com/frenetic-lang/frenetic/blob/master/async/Frenetic_Ox.mli)

[send_flow_mod]: https://github.com/frenetic-lang/ox/blob/master/lib/OxPlatform.mli#VALsend_flow_mod
[header accessor functions](http://frenetic-lang.github.io/frenetic/Frenetic_Packet.html)

[pattern]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01_Core.pattern
[send_flow_mod](https://github.com/frenetic-lang/frenetic/blob/master/async/Frenetic_Ox.mli)

[match_all]: http://frenetic-lang.github.io/frenetic/docs/OpenFlow0x01_Core.html#VALmatch_all
[pattern](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#TYPEpattern)

[example patterns]: https://github.com/frenetic-lang/ocaml-openflow/blob/master/lib/OpenFlow0x01_Core.mli
[match_all](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#VALmatch_all)

[header accessor functions]: https://github.com/frenetic-lang/ocaml-packet/blob/master/lib/Packet.mli
[Action](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#TYPEaction)

[PacketIn](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#TYPEpacketIn)

[Action]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01.Action
[PacketOut](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.html#TYPEpacketOut)

[PacketIn]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01_Core.packetIn
[OxPlatform](https://github.com/frenetic-lang/frenetic/blob/master/async/Frenetic_Ox.mli)

[PacketOut]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01_Core.packetOut
[Match](http://frenetic-lang.github.io/frenetic/Frenetic_OpenFlow0x01.Match.html)

[OxPlatform]: http://frenetic-lang.github.io/frenetic/docs/Ox_Controller.OxPlatform.html
[Packet](http://frenetic-lang.github.io/frenetic/Frenetic_Packet.html)

[Match]: http://frenetic-lang.github.io/api//openflow/#OpenFlow0x01.Match
[Network module](http://frenetic-lang.github.io/frenetic/Frenetic_Topology.Net.html )

[Packet]:http://frenetic-lang.github.io/api//packet/#Packet

[Network module]: http://frenetic-lang.github.io/api//topology/#Network

[Network_Common module]: http://frenetic-lang.github.io/api//topology/#Network_Common

[ocaml-topology repository]: http://frenetic-lang.github.io/api//topology/
[Topology](http://frenetic-lang.github.io/frenetic/Frenetic_Topology.html)



3 changes: 1 addition & 2 deletions _layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{% endif %}

{% endfor %}
<li><a href="https://arjunguha.github.io">Frenetic API Documentation</a></li>
<li><a href="http://frenetic-lang.github.io/frenetic/index.html">Frenetic API Documentation</a></li>

</ul>
</div><!--/.nav-collapse -->
Expand Down Expand Up @@ -93,7 +93,6 @@ <h1>Unindexed Chapter: {{ page.title }}</h1>
Insert next chapter link automatically.
{% endcomment %}


</div><!-- /.container -->


Expand Down

0 comments on commit f26f399

Please sign in to comment.