Skip to content

Commit

Permalink
Add directions for downloading VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-riecke committed Feb 29, 2016
1 parent ad6b905 commit cad78d9
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 26 deletions.
56 changes: 54 additions & 2 deletions Introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,60 @@ Software Environment

This is a hands-on tutorial with several programming exercises. We
recommend using the virtual machine we've prepared that has all the
necessary software that you need pre-installed. You can get the
tutorial VM from the following link: [Frenetic Tutorial VM](https://cornell.box.com/frenetic-4-tutorial).
necessary software that you need pre-installed. To run this, you need the
following open source software packages applicable for your host computer:

- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)

- [Vagrant](http://www.vagrantup.com/downloads): automates the process of
creating, provisioning, starting and stopping VM's.

The Frenetic Tutorial VM runs Ubuntu 14.04 as the guest OS. It has OCaml, OPAM, Mininet,
Wireshark, and Frenetic itself pre-installed. The standard VIM and Nano editor packages
are installed, but you can install your own through the normal Ubuntu package mechanisms.

The Frenetic tutorial VM is stored in the Vagrant cloud, and installing it requires
very little effort. First start up a command prompt on your Windows, Linux, or Mac
OS host PC. Then:

- Create a <code>frenetic-tutorial-vm</code> directory and change into it
- Issue a <code>vagrant init cr396/frenetic-tutorial</code>. This will create a
proper Vagrantfile in the directory.
- Type <code>vagrant up</code>. This command does the heavy lifting: downloading the
latest VM, installing it into Virtual Box, and creating the right credentials
- Lastly, type <code>vagrant ssh</code> to login to a command prompt on your VM.

The output will look something like this:

~~~ bash
$ mkdir frenetic-tutorial-vm
$ cd frenetic-tutorial-vm
~/frenetic-tutorial-vm$ vagrant init cr396/frenetic-tutorial
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
~/frenetic-tutorial-vm$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'cr396/frenetic-tutorial' could not be found. Attempting to find and install...

... lots of downloading and text

~/frenetic-tutorial-vm$ vagrant ssh
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-30-generic x86_64)

* Documentation: https://help.ubuntu.com/
Last login: Sun Feb 28 11:57:22 2016 from 10.0.2.2
vagrant@frenetic:~$
~~~

To use the VM:

- To start, change into the <code>frenetic-tutorial-vm</code> directory and type <code>vagrant up</code> followed
by <code>vagrant ssh</code>.
- To stop, simply exit from the Frenetic VM command prompt. Back at your host command prompt, type <code>vagrant
halt</code>. This step is optional - if you forget and shut down your host machine, the Frenetic VM will
itself shut down cleanly beforehand. But halting it will save you some memory and CPU cycles on the host.

References
----------
Expand Down
14 changes: 7 additions & 7 deletions NetKATFirewall/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ chapter. The ability to combine policies in a compositional way is one
of the key benefits of NetKAT's language-based approach.

Type this policy into a file `Firewall.ml` in the
`netkat-tutorial-workspace` directory.
`netkat-tutorial-solutions` directory.

#### Testing

To test your code, compile the firewall and start the controller in
one terminal,

~~~
$ netkat-build Firewall
$ ./netkat-build Firewall
$ ./Firewall.d.byte
~~~

Expand Down Expand Up @@ -107,7 +107,7 @@ let forwarding : policy =
~~~

Type this policy into a file `Forwarding.ml` in the
`netkat-tutorial-workspace` directory.
`netkat-tutorial-solutions` directory.

We want our firewall policy to wrap this forwarding policy:

Expand All @@ -131,14 +131,14 @@ let _ =
~~~

Save this policy into a file `Firewall2.ml` in the
`netkat-tutorial-workspace` directory.
`netkat-tutorial-solutions` directory.

### Testing

- Build and launch the controller:

~~~ shell
$ netkat-build Firewall2
$ ./netkat-build Firewall2
$ ./Firewall2.d.byte
~~~

Expand Down Expand Up @@ -221,7 +221,7 @@ Then you should modify the firewall to only allow ICMP traffic between
hosts `10.0.0.3` and `10.0.0.4`.

Type this policy into a file `Firewall3.ml` in the
`netkat-tutorial-workspace` directory and test it in Mininet. Note
`netkat-tutorial-solutions` directory and test it in Mininet. Note
that due to the access control policy, it probably makes sense to test
a few points of the access control policy. For example, if you run
_fortune_ on port 80 on `h1`,
Expand All @@ -242,6 +242,6 @@ flow using conditionals. However, using NetKAT's predicates (`p1 &&
p2`, `p1 || p2`, and `!p`) is is often possible to write a more
compact and legible policy. Revise your advanced firewall this policy,
putting the result in a file `Firewall4.ml` in the
`netkat-tutorial-workspace` directory and test it in Mininet.
`netkat-tutorial-solutions` directory and test it in Mininet.

{% include api.md %}
7 changes: 3 additions & 4 deletions NetKATRepeater/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ programming language, and let a compiler and run-time system handle
the details related to configuring switch flow tables (as well as
sending requests for statistics, accumulating replies, etc.)

The templates for this part are in
`src/netkat-tutorial-solutions`.
You will place these files in `netkat-tutorial-solutions`.

~~~
$ cd src/netkat-tutorial-solutions
$ cd netkat-tutorial-solutions
~~~

### Example 1: A Repeater (Redux)
Expand Down Expand Up @@ -77,7 +76,7 @@ To run the repeater, type the code above into a file
start the repeater controller using the following commands.

~~~
$ netkat-build Repeater
$ ./netkat-build Repeater
$ ./Repeater.d.byte
~~~

Expand Down
4 changes: 2 additions & 2 deletions NetKATRouting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ Using NetKAT, write a forwarding policy that connects all hosts to each other. Y
>>
~~~

Save this in a file called `Routing.ml` and save it in the `netkat-tutorial-workspace` folder.
Save this in a file called `Routing.ml` and save it in the `netkat-tutorial-solutions` folder.

#### Testing

Compile and start the controller:

~~~
$ netkat-build Routing.d.byte
$ ./netkat-build Routing
$ ./Routing.d.byte
~~~

Expand Down
4 changes: 2 additions & 2 deletions OxLearning/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ learns host locations.

You should use the template below to get started. Save it in a file
called `Learning.ml` and place it in the directory
`~/src/frenetic-tutorial-workspace/Learning.ml`.
`~/src/ox-tutorial-solutions/Learning.ml`.

~~~ ocaml
(* ~/src/frenetic-tutorial-workspace/Learning.ml *)
(* ~/src/ox-tutorial-solutions/Learning.ml *)
open Frenetic_Ox
open Frenetic_OpenFlow0x01
Expand Down
4 changes: 2 additions & 2 deletions OxMonitor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ let packet_in (sw : switchId) (xid : xid) (pktIn : packetIn) : unit =

Use the following code as a template for this exercise. Save it in a file
called `Monitor.ml` and place it in the directory
`~/src/frenetic-tutorial-workspace/Monitor.ml`.
`~/src/ox-tutorial-solutions/Monitor.ml`.

~~~ ocaml
(* ~/src/frenetic-tutorial-workspace/Monitor.ml *)
(* ~/src/ox-tutorial-solutions/Monitor.ml *)
open Frenetic_Ox
open Frenetic_OpenFlow0x01
Expand Down
4 changes: 2 additions & 2 deletions OxNat/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ $ sudo mn --controller=remote --topo=single,3 --mac --arp
#### Programming Task

Use the template below to get started. Save it in a file called
`Nat1.ml` and place it in the directory `~/src/frenetic-tutorial-workspace/Nat1.ml`.
`Nat1.ml` and place it in the directory `~/src/ox-tutorial-solutions/Nat1.ml`.

~~~ ocaml
(* ~/src/frenetic-tutorial-workspace/Nat1.ml *)
(* ~/src/ox-tutorial-solutions/Nat1.ml *)
open Frenetic_Ox
open Frenetic_OpenFlow0x01
Expand Down
6 changes: 3 additions & 3 deletions OxRepeater/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ message. Therefore, this repeater only needs to provide a `packet_in`
handler. We have provided some starter code in a template below.

Fill in the body of this function and save it in a file called
`Repeater.ml`.
`ox-tutorial-solutions/Repeater.ml`.

~~~ ocaml
open Frenetic_Ox
Expand Down Expand Up @@ -141,10 +141,10 @@ the [OpenFlow_Core] module) and fill it in.

<h4 id="compiling">Compiling your Controller</h4>

To build your controller, run the following command:
To build your controller, run the following command from the <code>ox-tutorial-solutions</code> directory:

~~~
$ ox-build Repeater.d.byte
$ ./ox-build Repeater.d.byte
~~~

Assuming compilation succeeds, you will see output like to this:
Expand Down
2 changes: 1 addition & 1 deletion OxRouting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ path back to a given source.

* Build and launch the controller:

$ ox-build Routing.native
$ ./ox-build Routing.native
$ ./Routing.native


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locally, you'll need to checkout the gh-pages branch:
$ git clone -b gh-pages [email protected]:frenetic-lang/tutorials.git

If you want to preview your changes locally before pushing, you'll need to
install [Jekyll].
install [Jekyll]. Type "jekyll serve" to start up a local server.

[GitHub Pages]: https://pages.github.com
[Jekyll]: http://jekyllrb.com

0 comments on commit cad78d9

Please sign in to comment.