The GENI Developer Docs

These documents are intended to help software developers become familiar with GENI, a project sponsored by the National Science Foundation, to help experiment with future networks. The “what and why” of GENI is discussed in the next section, but overall, GENI is a platform for:

  • Exploring gigabit networks
  • Implementing new routing rules in those networks
  • Writing applications which leverage these networks

A major benefit to GENI is that experiments can run “at scale”, meaning they just aren’t simulated in a lab, but can be run on machines that you provision across the world.

Read on to find out why GENI exists.

Introduction

Let’s talk about what you can do with GENI, how GENI is architected, and how you can get started.

Contents

What Is GENI?

GENI is both a project sponsored by the NSF and commonly refers to a number of applications and tools used to build and experiment with high-speed programmable networks. These tools are being developed by various institutions, and the efforts surrounding GENI are still very much in progress.

A Short Background (Or, What Are the Limitations of the Internet Today?)

The landscape of the internet has changed dramatically since its beginnings as ARPANET in 1969. The devices using it have grown to include everything from PCs, laptops, and mobile phones to TVs, cars, and refrigerators. In addition to the range of devices, growing advanced in video and voice technology require greater bandwidth.

Although some of these applications were foreseeable, this is not what the current architecture of the internet was intended for.

Vint Cerf, widely considered a father of the internet gives a talk below, commenting on the internet’s beginnings and its inherent limitations.

A Global Environment for Network Innovations (GENI)

Experimentation and research into highspeed networks, new protocols, and distributed applications was previously limited to isolated labs. The GENI project was started to facilitate wide-scale experimentation — creating a virtual laboratory where engineers, researchers, and developers have access to:

  • Programmable Networks: Routers can be programmed to handle packets in new ways; opening the door to experimenting with alternatives to the core protocols of the internet.
  • Gigabit Networks: High speed networks that are 250 times faster than what is available today
  • Virtual Machines: Provisionable environments for running applications that leverage these programmable, high-speed networks.

GENI refers to both the overall project and the suite of tools and services that have been developed around the 3 items above. This documentation exists to show you how, as a developer, you can get set up and write your own next-generation applications.

It’s the Side of Hacking You Haven’t Been Exposed To

How long have you taken TCP/IP for granted? How long have you build your web applications upon the decades-old work of others? With GENI, you are exposed to a new frontier of hacking.

Read more about what you can do with GENI.

What Can I do With GENI?

The GENI platform is very open-ended, but it’s intended to be an environment for:

  • Exploring gigabit networks
  • Implementing new routing rules in those networks
  • Writing applications which leverage these networks

Examples

Here are a few project ideas that are possible with GENI tools and resources.

Write an application that can utilize gigabit connections

Gigabit internet connections are the future. So what kind of network-reliant applications could you build that aren’t possible with the typical consumer internet speeds of today?

Test how different protocols are affected by network bottlenecks

If you wanted to compare, for instance, how TCP and UDP perform under different levels of network congestion, you could easily simulate that with GENI

Build distributed applications

You have considerable computing and network resources available via GENI, so you can develop and test your next-generation distributed applications over gigabit links.

Design an alternative to the IP protocol

Is IP holding you back? Define the rules that a router follows for forwarding packets, and experiment with what could be the internet’s future backbone protocol.

Going Forward

Are you ready to dig into GENI? Check out the prerequisites to make sure you can hit the ground running.

What You Need to Know Before Starting

Before you dive into using GENI, there are a few concepts that you should be familiar with beforehand. A good grip on these concepts will ensure that you can follow along with various GENI tutorials, examples, and videos.

GENI Credentials

You’ll need GENI credentials before you can start experimenting. Click here to find out how to get set up with those.

Virtual Machines

We’ve mentioned that GENI is a virtual laboratory for running network experiments. As a GENI user, you are allowed to request and allocate resources around the world, such as virtual and physical machines.

It’s a good idea that you understand the basic difference between the different machine types. Sometimes it’s helpful to work with specific machine types in your experiments.

Linux and Relevant Utilities

It’s important that you are comfortable with using the Linux/UNIX command line. You will be using it heavily in the process of running your experiments, and it’s the only method you’ll have for controlling your resources.

In particular, make sure you’re well versed with:

  1. A unix shell, such as bash
  2. The ssh utility (used for connecting to your machines)
  3. The ping utility
  4. Setting up and using SSH keys (your only login method)
  5. A scripting language, like ruby or python

Networking

What good would access to computing resources around the world be without a way to connect them? A basic understanding of computer networking concepts is important to have.

More specifically:

  1. The layers of the OSI model
  2. Internet Protocol, or IP, the backbone protocol of the internet
  3. TCP and UDP
  4. Connections over the mentioned protocols using socket APIs
  5. How data packets are routed around the internet

When you feel comfortable with the topics above, you can move on to read about the terms and concepts used when discussing GENI.

How Is GENI Set Up?

For the purposes of this section, the lower-level details of how GENI is set up are spared. The “Additional Resources” section, although, contains a link to a more extensive document authored by the GENI Project Office.

GENI Setup: A Developer’s View

The basic work-flow of a developer looking to start building on GENI offers a nice view on the structure of the GENI project. So let’s consider Alice, a fictional GENI wannabe-experimenter.

From the top: Clearinghouse

In order to start interacting with GENI, Alice need to become a GENI user. Alice can obtain credentials from a GENI Clearinghouse. A GENI Clearing house can issue credentials that are federated, meaning that they are recognized by all GENI Management Authorities.

What’s in a Management Authority?

A Management Authority, or Manager, is an organization or institution that makes resources available to experimenters like Alice. These resources are made available via APIs. As a developer, Alice does not have to deal directly with these APIs because of GENI tools that are available to her.

What Tools?

Once Alice has GENI credentials, she can use tools like OMNI or Flack. Because Alice wants to dive in quickly, she opts for Flack, the visual web-based option.

Alice wants to start an experiment, so she needs to create an environment for her experiment, called a slice. The slice Alice creates via Flack will be recognized throughout by all of the GENI Management Authorities, which supply the resources and slivers that she needs.

What’s a Sliver?

Once Alice has her slice set up, she’ll want to request virtual machines from different Managers. The virtual machines, and any other resources that Alice might request are collectively referred to as slivers. They are called ‘slivers’ because they are often virtualized and shared components of a physical machine.

Whereas a slice is a global container for Alice’s experiments, the collection of resources she is using on any given site is referred to as a sliver. So if she has 2 nodes running in Utah, that’s one sliver, and her nodes running in Washington DC are in another sliver.

And that’s it

Now that you have a basic idea of how GENI is set up from a (very) high level, it’s best to move on the the more extensive GENI Terms and Concepts section.

Additional Resources

A glossary of the terms italicized in the document are available in the GENI Terms and Concepts section.

A more encompassing document with lower-level details on GENI architecture is available here.

Key Terms and Concepts

Before you jump into reading the core GENI documentation, you should become familiar with the terminology used when discussing the project. Because GENI is a recently-developed, global platform, an evolving set of terms is used to described the details.

Throughout the definitions, we’ll refer the figure below for reference. This is Flack, the visual interface used to interact with GENI. Flack is described in further detail below and in the Flack guide.

Figure 1: Flack

_images/flack-slivers.png

Terms List

The list of terms below is organized in a way that the items further up on the list will help build your understanding of the terms toward the end of the list. Terms mentioned within definitions are in italics.

Resources

A resource is a generic term used to describe anything you can request and use on the GENi platform. It may include physical machine, virtual machines, network hardware and more. in the image of Flack above, the types of resources you can request from GENI are in the drop-down menu in the center of the screen (All types, firewall, etc).

Credentials

Your credentials are your keys to using the GENI environment. Once you have GENI credentials, you may begin setting up environments, requesting resources, and using the various tools that have been developed for GENI. Your credentials come in the form of a username, SSH key, and a password.

Flack

Flack is pictured at the top of this document. It’s is a visual tool for setting up experiment environments (known as a slice), requesting resources (such as a sliver), and setting up network paths between them. Much of your interfacing with GENI in experiments and examples will be through Flack. You can learn more about using Flack here.

Omni

Omni is a command-line tool for interacting with GENI. You can allocate resources like you can do with Flack, but without the visual interface. Omni is a powerful utility, which you can learn more about here.

Slice

A slice is an environment and conceptual container that your resources reside in. A single slice is recognized globally throughout the GENI environment. Within each slice, you can request resources from any GENI authority. Note that in the image of Flack above, A slice named “TestSlice” has been created.

Sliver

a sliver is a set of resources that are reserved in an AM for a slice, i.e. slivers are what a user has in specific AMs

Up until now, we have referred to the different computing and network components that you allocate within GENI as resources. On GENI, you may have resources in many different places. For example, maybe you have resources allocated in Utah, and you have other resources allocated in Washington DC.

In GENI terminology, a sliver refers to the set of resources in a single location. So that group of resources in Utah is one sliver, and the grouping of resources in Washington DC is another sliver.

Your slivers are all part of the same Slice.

In the Image of Flack above, you can see the sliver that is going to be allocated for the slice named ‘TestSlice’: 1 Virtual Machine (VM), 1 Physical Machine (PC), and network interfaces to link them (lan0).

Clearinghouse

A Clearinghouse is a GENI authority that is capable of signing users up to experiment with GENI. In the GENI architecture, there are multiple clearinghouses. If you are gaining credentials through the The Mozilla Ignite App Challenge, your clearinghouse will be located at pgeni.gpolab.bbn.com.

Federation

This is the general idea that once you receive your GENi credentials from a Clearinghouse, you can use them to request resources and slivers anywhere. In visual tools such as Flack, this is largely transparent.

Management Authority (Authority)

Resources around the world are managed by what is called a Management Authority. This is typically an organization or institution that manages the servers and virtual machines on their premises, and makes them available to GENI as a whole. In the image of Flack above, the “Managers” list on the far left are the Management Authorities.

Resource Specification (RSpec)

Also largely transparent to the end user when using tools such as Flack, a Resource Specification, more commonly called an RSpec, is an XML document that lists resources. It is used in two primary cases:

  1. When querying a Management Authority on what types of resources it has available. Before you ask for a few machines for your experiment, you need to know what is available to you, right? This is called an Advertisement RSpec.
  2. Once you get a list of resources available to you, and you decide what you need, you send an RSpec that describes the resources you are requesting to the appropriate Management Authorities.

Again, with a visual tool such as Flack, you don’t have a reason to build or read RSpecs manually. Flack does the work for you. If you are curious although, Flack allows you to both read the RSpecs it has created for you, and import RSpecs that you have written yourself or saved prior.

Ticket

When a request is made for resources (And an RSpec is sent out), the Management Authorities typically issues Tickets, which is essentially a promise to fulfill the request. Sometimes, requests cannot be fulfilled for various reasons.

Seattle

Seattle is another project under the GENI umbrella which allows you allocate virtual machines around the globe and run experiments. Some of these virtual machines reside on physical machine, host virtual machines, and even mobile devices. Because of the transient connectivity of some devices, it is very helpful for simulating what the internet is really like for experiments. You do not need GENI credentials to use Seattle. Anyone can sign up.

Additional Resources

This list is a modification of the original GENI glossary available at GENI.net. It has been modified to be of use specifically to developers. You are encouraged, however, to read as deeply into GENI as you see fit.

  1. Geni.net GENI Glossary

Setup

You’re now ready to sign up and start experimenting with GENI. The first thing you need to do is acquire GENI credentials. When that’s finished, you’re encouraged to try out the GENI Quick Start in order to see the fundamentals of working with GENI.

Contents

Get Your GENI Credentials

Before you can jump into using GENI tools and services, you will need to obtain an account with a GENI clearinghouse.

Mozilla offers GENI access to developers and experimenters participating in the Mozilla Ignite App Challenge. If you’re interested in hopping on GENI and getting access to gigabit speed and OpenFlow testbeds, send a note to kenny@mozillafoundation.org.

GENI Quick Start

Getting started with GENI and building a solid understanding of its capability is as easy as:

At that point, you may feel comfortable enough to start exploring what sort of tools and resources are available to you on GENI, or perhaps dive into gigabit networking and OpenFlow.

So after you’ve completed the 3 points above, branch out and explore:

And lastly, if you’re a hacker who wants to build webapps of the future, be sure to check out the list of tips and trick for hackers, which will come in handy as your apps and experiments become for sophisticated and user-oriented.

Tips and Tricks for Hackers

There are a few handy tricks that you can use to fully experience the apps you’re building. This document contains a few tricks that may be useful.

See Your Gigabit App Through A Browser

If you have a box in Utah and another in DC, as we did in example 2, with a gigabit link in between, it may be nice to see your app through a browser.

For example, perhaps one box was intended to act as a client, and another as a web server, because you’re building a next-generation webapp that relies on a high speed connection. Using you application from home doesn’t take advantage of the high speed link the client box has, so you need to see your app through the eyes of the client, as if you were sitting in Utah.

X, commonly called X11 is a tool that can use to gain a remote desktop capability with your provisioned client. This is possible if:

  1. The system you are remoting from (your Mac, Thinkpad, windows box, etc) supports X11
  2. The system you are remoting to supports X11, and has SSH installed

In terms of requirement number 1, this is easiest is your laptop or desktop has a recent version of OSX or Ubuntu installed. It’s possible with a Windows computer too, with a little extra work.

Requirement #2 is easily satisfiable if the system you are remoting to has Ubuntu installed. From there, getting X11 and a Firefox browser installation is as simple as:

$ sudo apt-get update
$ sudo apt-get install xorg openbox ubuntu-desktop firefox

And then from your terminal:

$ ssh -X username@pcXXX.genihost.net

At that point, any windowed application you run in the terminal on the remote host will open a window on your local machine. Try something like:

$ firefox

And you should see a window appear, showing your Firefox browser running remotely.

Accessing Nodes Behind Firewalls

In a couple of the example projects, we set up nodes in Utah and Washington DC. In DC, the names of our nodes were prefixed with pg. For example, the name of the node might be something like pg502.

Nodes prefixed with pg are behind a firewall, and accessing them can only be done through another node networked with them. For that reason, it’s easiest to set up an SSH tunnel to reach the pg node.

This is a necessary part of completing Example 2, so it would be good to know how this works ahead of time.

Setting Up an SSH Tunnel

Let’s say that we have two GENI nodes set up: pc100, and pg200.

Locally, you would open up two SSH terminals. One will be for connecting to pc100 at pc100.emulab:22.net, and the other will be for connecting to pg200 at pg200.emulab.net:22.

We can easily connect to pc100 directly in one terminal. But in the process, we’re going to have a tunnel open on that same connection. For example, we’ll execute something in the form of:

$ ssh -p [pcxxx port] [username]@[pcxxx host] -L 2222:[pgxxx host]:[pgxxx ssh port]

How generic! Let’s put that into perspective for our example, with the username ‘katzgrau’. We’ll execute:

$ ssh -p 22 katzgrau@pc100.emulab.net -L 2222:pg200.emulab.net:22

At that point, you should have connected by SSH to pc100. Now, we’re in the clear to connect to pg200. The generic for would look like:

$ ssh -p [local tunnel port][username]@127.0.0.1

But in this example, we’ll execute:

$ ssh -p 2222 katzgrau@127.0.0.1

Our SSH connection will be routed through pc100 over to pg200, and we should be good to go!

If you find yourself having trouble with this, it may be wise to read up on SSH tunnels in general. They can be confusing to a newcomer, but that barrier is easily overcome. In addition, creating tunnels can be very handy in your experiments.

Saving Configurations/RSpecs

If you’ve gone through the trouble of setting up a complex topology with specially configured nodes, it can be extremely helpful to save configuration of your experiment into an RSpec/text file. Next time that you want to set up the same experiment, you can load in the RSpec.

To see the RSpec that was generated while you were configuring your project, click the “View” dropdown on the upper left of the slice pane:

_images/tips-preview-rspec.png

From there, click “Preview request documents”, and you should see:

_images/tips-view-rspec.png

You have the copy to copy this RSpec or save it to a file. It’s probably best to save it to a file so you can load it up later. When that time comes, click the “Import” dropdown.

_images/tips-import-rspec.png

When you import the RSpec, your experiment will be created with all the same settings and configurations it had before.

Examples

Contents

Example 1 - Set Up 2 VMs and Ping

In this short experiment you’ll learn how to set up 2 virtual machines that can ping each other on the GENI platform. You’ll need to get GENI credentials before you can complete this example.

Tutorial

If you run into any problems with this tutorial, reach out to kenny at mozillafoundation dot org.

Step 1. Log In to Your Management Authority

For this tutorial we’re going to use Flack, the browser-based visual tool for interacting with GENI. The easiest way to authenticate with Flack is to simply be logged in to your clearinghouse’ website in one window or tab, and to have Flack open in another window or tab.

Figure 1: Logging in to a management authority (yours may differ)

_images/geni-ma-login.png
Step 2. Open Flack In A New Tab

Flack is an in-browser tool written in Flash. It’s likely you already have flash installed, but if you don’t you can get it here:

Open Flack in a new tab or browser window. Flack can be found here: www.protogeni.net/trac/protogeni/wiki/Flack . You should see Flack initialize in the window, as in the figure below:

Figure 2: Flack Initialized

_images/flack-init.png
Step 3. Log In With Flack

Click the green “Log In” button above. Here, you are expected to paste your GENI private key. But because we are already logged into our management authority via another tab, we can complete this step easily and have our private key information inserted automatically.

Along the top of the prompt, there should be a button and dropdown box that says “Download from [Select authority]” as in the figure below.

_images/flack-pick-ma.png

Select your management authority’s domain from the dropdown. The correct domain to choose will match up with the domain where you logged in at Step 1.

Once the correct item is selected, click the “Download” button next to the option list. Your certificate (credentials) should appear, as in the figure below:

_images/flack-download-pk.png

Finally, enter the private key passphrase that you used when you signed up at your management authority when you signed up. Click “OK” on the bottom left.

At this point, Flack will attempt to retrieve resources from the various authorities. When prompted to select where to list resources from, leave all of the options checked and click “Continue”. Flack will gather the resources lists, and display a map of North America, as pictured below:

_images/flack-map.png
Step 4. Create a New Slice

You’re now ready to create a GENI “slice.” Your slice is a GENI-wide environment that you can add resources to, and run experiments in. For more on GENI terminology, see the glossary.

Click on the “New” button in the top-left corner of Flack, and enter a name for this slice. Your slice name will have to be unique from all other GENI slices, so it cannot be the same name as in the example.

_images/flack-new-slice.png

When you’re finished typing the name of your slice, click “OK”. Once your slice has been created (it may take a moment), you’ll see a blank pane with the name of your slice toward the top of your screen. The blank pane on the right is where we’ll set up our experiment.

_images/flack-slice.png
Step 6. Send A Ping From One Node to the Other

At the last step in Step 5, you should see the connection info for each node listed to the right of it. For example, the hostname and port of the nodes in the example are.

  • VM: Host pc533.emulab.net port 31290
  • VM-0: Host pc533.emulab.net port 31291

If I open a terminal window, I should be able to connect to both without using a password:

Logging into VM

_images/ex1-login1.png

Logging into VM-0

_images/ex1-login1.png

As mentioned before, the hosts are already networked, and conveniently, there are already hosts for the appropriate IPs for VM and VM-0 in each host file:

_images/ex1-cat-hosts.png

At this point, we’re ready to ping one host from the other. Open the window for machine VM and type:

ping -c 2 VM-0

This will ping VM-0 twice. The -c flag allows us to limit the number of pings to 2. You should see something very similar to:

_images/ex1-ping.png

If you did, congratulation! You’ve just confirmed your two new GENI VMs can talk to each other! If you’re a bit handy with client/server apps, what might you be able to code up at this point?

If things didn’t go so well, see the troubleshooting section below and see if you can address any issues.

Troubleshooting

Did this experiment fail to go as planned? Ping kenny at mozillafoundation dot org and share the details. Or, see if your problem can be addressed below.

I clicked ‘Submit’ to create my machines, but there was an error

Occasionally a request to provision machines cannot be fulfilled. You can always try:

  • Deleting the failed resources if necessary (a red background means failure)
  • Submitting the request again
  • Trying to provision machines from a different management authority
I can’t log into my machines via SSH

Double check that your public SSH key (usually on your computer at something similar to ~/.ssh/id_rsa.pub) is registered with your Management Authority user account. When your machines are provisioned by GENI, your public key will be placed in the ~/.ssh/authorized_keys file on each host so you will have a password-less login.

Example 3 - Programming Networks with OpenFlow

Note: This example references many topics which were discussed in example 1 and example 2, which act as sufficient prerequisites.

The full “what and why” of OpenFlow is discussed in the core documentation, but the reason you would want to use OpenFlow is to program how exactly your network behaves. For example, maybe you want to write a custom protocol and segment traffic in your network. Maybe you simply want to play around with a programmable switch.

OpenFlow is the leading architecture of Software Defined Networking (SDN), which is shaping up to be the future of deeply programmable networks.

In this experiment, we’re going to get a software OpenFlow switch up and running on a single machine on GENI. Our node will act as an OpenFlow switch and it will be networked with two additional machines. We’re going to send ping packets through our switch from one node to another, and then program the switch to drop any packets headed from one node to another.

Our virtual topology will look like this:

_images/ex3-topology.png

The node on the left will be the node we send packets to, and the node on the right will be the receiver of the packets. The node in the middle will be our software switch.

Tutorial

Step 1 - Set Up Our Network

Open up Flack as we did in the previous example, and create a new slice, giving it a unique name:

_images/ex3-new-slice.png

When you’ve submitted the new slice request, and the slice is created, click into it so you have a blank pane in front of you:

_images/ex3-blank-pane.png

Drag three PC nodes from utahemulab.cm on the pane:

Before:

_images/ex3-topo-before.png

After:

_images/ex3-topo-after.png

Important: The node in the middle will be our network switch.

The next thing we’ll want to do is network our three machines together. For this, we’ll drag two LAN components onto the pane. We want to have two distinct networks, so we’ll network the switch and the node on the left first, and secondly, the node on the right and the switch.

Firstly:

_images/ex3-network-step-1.png

Secondly:

_images/ex3-network-step-2.png

Now we’re ready to configure out individual boxes.

Step 2 - Specify Ubuntu As the Operating System and Submit

Let’s configure all three nodes so that they have Ubuntu installed. For the node on the left, click on the information icon:

_images/ex3-os-setup-i.png

In the pane that appears, head to the “Disk Image” field, and find the option for “Ubuntu 12.04 LTS with KVM installed”. Select that:

_images/ex3-os-setup-select.png

Click “Apply” at the bottom, and do the same for the other two nodes in our network. When you’re done, each node should be marked as having the Ubuntu OS configured:

_images/ex3-os-setup-final.png

We’ve got our network set up! We’re ready to submit our request to provision these nodes. Click “Submit” on the bottom of the screen. If you hit any errors while provisioning, you can submit again.

Step 3 - Install Open vSwitch

The node in the middle is going to be our switch. A this point, that node should have an address next to it, such as pcXXX.emulab.net, possibly with a port number. SSH into that back in a new terminal. In the example above, we’ll do:

$ ssh pc209.emulab.net
$ sudo bash

We executed sudo bash since we’re going to be doing a lot of heavy lifting that requires root. Now we need to install Open vSwitch. This is actually very easy, and only requires that we install a few packages with the apt package manager and do some housework. First, run these commands and confirm ‘Yes’ any prompts.:

$ apt-get update
$ apt-get install openvswitch-datapath-source bridge-utils
$ module-assistant auto-install openvswitch-datapath
$ apt-get install openvswitch-brcompat openvswitch-common
$ apt-get install curl traceroute

Now, we’ll do a little editing. Execute:

$ nano /etc/default/openvswitch-switch

And change the line that says:

# BRCOMPAT=no

To:

# BRCOMPAT=yes

And finally, restart Open vSwitch:

$ /etc/init.d/openvswitch-switch restart
Step 4 - Configure Open vSwitch to Use our Ethernet Interfaces

This next step truly depends on the box that you’re working on. You need to know which interfaces you’re going to be working with for the next steps. To do that, run:

$ ifconfig

In the output, you’ll see a few different interfaces. The ones you need are prefixed by ‘eth’, and end with anything between 1 and 5. In the example, below, the two interfaces relevant to us are eth2 and eth4. Take note of your interfaces, and apply them to the instructions below, along with the appropriate IP addresses.

_images/ex3-interfaces.png

So we have interfaces eth2 and eth4. We want to configure Open vSwitch to use those interfaces as if they were the interfaces of a switch. We do this by setting up a virtual bridge interface. Type, or copy and paste these lines into your terminal:

ovs-vsctl add-br br-int
ovs-vsctl add-port br-int eth2
ifconfig eth2 0
ifconfig br-int 10.10.1.2 netmask 255.255.255.0
route add -net 10.10.1.0 netmask 255.255.255.0 dev br-int

ovs-vsctl add-br br-int2
ovs-vsctl add-port br-int2 eth4
ifconfig eth4 0
ifconfig br-int2 10.10.2.1 netmask 255.255.255.0
route add -net 10.10.2.0 netmask 255.255.255.0 dev br-int2

At this point, running another:

$ ifconfig

Should show your new bridge interfaces:

_images/ex3-interfaces-final.png

Your switch is ready to go! Now you just need an OpenFlow controller.

Step 5 - Set Up Floodlight, an OpenFlow Controller

Your OpenFlow switch is controlled by an OpenFlow controller. An OpenFlow Controller is just a software package that interfaces with the switch via the OpenFlow API, and pushes routing rules.

In a situation where you had a hardware-based openflow switch, the controller would reside on a separate host. We’re using a software based switch in the example, and for convenience, we’re going to install the controller on the same box as our software switch.

Again, we’ll install a package and run a series of commands:

$ apt-get install build-essential default-jdk ant python-dev uml-utilities git
$ git clone git://github.com/floodlight/floodlight.git
$ cd floodlight
$ make
$ java -jar target/floodlight.jar

We’ve just started our Floodlight controller. This controller will act as our interface to the switch. Since we just started the controller, we’ll see log messages appearing on the screen:

_images/ex3-floodlight-log.png
Step 6 - Test Our Switch

Because Floodlight is running in our terminal, we’re going to open up another terminal window and ssh into our switch so we can keep working. We’ll also tell the switch to listen to the Floodlight controller while we’re at it:

$ ssh pc209.emulab.net
$ sudo bash
$ ovs-vsctl set-controller br-int tcp:127.0.0.1:6633

Additionally, we’re going to open up a connection to the machine in our topology labeled PC. Your address will be different. Check your topology pane for the correct address:

$ ssh pc536.emulab.net
$ sudo bash

Now let’s install a package of utilities we can use to test switch connectivity:

$ apt-get install uml-utilities traceroute

Next, From PC, let’s ping PC-0 to make the boxes on both ends of the switch can talk to each other:

$ ping pc-1

This should yield something similar too:

_images/ex3-switch-connectivity-before.png

Great! Right now let’s test the route our packets are taking from PC to PC-0. We want to make sure our packets are flowing through the switch we set up. We can double-check by running:

$ route -n

Which would yield:

_images/ex3-route-n.png

In the output above, you can see that our route from PC to PC-1 is indeed through the switch we set up. If you would like, you can also test with traceroute, in the manner of:

$ traceroute pc-1
Step 7 - See Floodlight’s Web Interface

Floodlight has a simple web interface built in. It allows you to see which nodes are connected to the switch, and which rules are currently active. Access it by opening a browser window to:

http://pcXXX.emulab.net:8080/ui/index.html

Of course, replace your switch’s hostname with the one above.

Additionally, take note of the DPID of the switch that you created:

.. image:: ../assets/images/ex3-floodlight-ui.png
Step 8 - Put Some Routing Rules!

Now for the programmable networks part of our openflow experiment. Let’s get back in the terminal window that is connected to our switch. We’ll now add a rule to our switch through Floodlight that will drop any packets coming from PC (10.10.2.2). Be sure to adjust your IPs below if they don’t match up. Also, replace [DPID] with the DPID you found above:

$ curl -d '{"switch": "[DPID]", "name":"drop-flow", "src-ip": "10.10.2.2", "dst-ip":"10.10.1.1","active":"true"}' http://127.0.0.1:8080/wm/staticflowentrypusher/json

Let’s make sure that rule was pushed correctly, by issuing:

$ curl http://127.0.0.1:8080/wm/staticflowentrypusher/list/[DPID]/json | json_pp -t dumper

And you’ll see something similar to:

_images/ex3-floodlight-rules.png
Step 9 - Retest That Switch

Go back to step 6 where we were on PC, and try to ping PC-1. How did that work? Did it fail?

Congratulations! You programmed your first switch with a simple JSON packet. If you want to remove the rule and try once more, you’ll find that your packets are free to flow again:

$ curl -X DELETE -d '{"name":"drop-flow"}' http://127.0.0.1:8080/wm/staticflowentrypusher/json
Step 10 - Think About The Applications

For the purposes of this example, we manually pushed all the required JSON rules to demonstrate the programmability of the switch.

But imagine that instead of pushing the rules manually, you wrote a web application to push those rules instead. Since the switch is now controllable with something like JSON, you can truly define the behavior of your network with software. That’s the essence of software-defined networking!

Additional Resources

This tutorial was adapted from this blog post for GENI: http://networkstatic.net/2012/06/openflow-openvswitch-lab/

For more on the Floodlight REST API, and what methods are available: http://www.openflowhub.org/display/floodlightcontroller/REST+API

GENI Tools and Services (A Rundown)

Contents

Flack

Flack is a visual tool that you can use to provision and network machines on GENI. It’s similar to omni in terms of capability, however omni is a command-line tool that provides a wider range of abilities.

Because of it’s low barrier to entry, Flack is the preferred tool for getting developers up and running quickly, and the example GENI projects use it exclusively.

This document will go over the different features of Flack that may not have been touched in the examples.

Logging In to Flack

The easiest way to authenticate with Flack is to simply be logged in to your clearinghouse’s website in one window or tab, and to have Flack open in another window or tab.

_images/geni-ma-login1.png

Open Flack in a new tab or browser window. You should see Flack initialize in the window, as in the figure below:

_images/flack-init1.png

Click the green “Log In” button above. Because we are already logged into our management authority via another tab, we can complete this step easily and have our private key information inserted automatically.

Along the top of the prompt, there should be a button and dropdown box that says “Download from [Select authority]” as in the figure below.

_images/flack-pick-ma1.png

Select your management authority’s domain from the dropdown. The correct domain to choose will match up with the domain where you logged in at Step 1.

Once the correct item is selected, click the “Download” button next to the option list. Your certificate (credentials) should appear, as in the figure below:

_images/flack-download-pk1.png

Finally, enter the private key passphrase that you used when you signed up at your management authority when you signed up. Click “OK” on the bottom left.

At this point, Flack will attempt to retrieve resources from the various authorities. When prompted to select where to list resources from, leave all of the options checked and click “Continue”. Flack will gather the resources lists, and display a map of North America, as pictured below:

_images/flack-map1.png

Creating a Slice

Click on the “New” button in the top-left corner of Flack, and enter a name for this slice. Your slice name will have to be unique from all other GENI slices, so it cannot be the same name as in the example.

_images/flack-new-slice1.png

When you’re finished typing the name of your slice, click “OK”. Once your slice has been created (it may take a moment), you’ll see a blank pane with the name of your slice toward the top of your screen. The blank pane on the right is where we’ll set up our experiment.

_images/flack-slice1.png

Looking For Resources

In the figure below, we have a new slice aptly named “tutorialslice”, which is listed in box A. In box B, there is a list of the resource types that are available to our topology.

The dropdown control at the top of box B will filter the resource types shown. You can select “raw-pc”, which will show only physical computers, emu-vmz, which will show only virtual machines, and other types of resources.

When you find a resource you’d like to use, drag it over to box C.

_images/flack-slice-tools1.png

Configuring Compute Resources

In order to configure a computer resource like a VM or PC that is already in your topology, click the “information” icon of the node:

_images/ex3-os-setup-i1.png

You will see a configuration pane appear, with an option to select the “Disk Image”. This is essentially the base image, and more importantly, the operating system that will be installed to your resource. At this time selecting the disk image is limited to PCs:

_images/ex3-os-setup-select1.png

For both PCs and VMs, you are able to add “install services”. If you have the URL of a tar’d and gzip’d file with package source code (as most packages are distributed), you can add it here so it will be installed automatically when the machine is brought up:

_images/core-pc-install-package1.png

Configuring Network Resources

You can set certain properties of your lan resources, such as the requested link capacity, latency, and packet loss rate. Do that by clicking the lan’s information icon:

_images/ex2-gig-lan-info1.png

And setting the appropriate values in the fields:

_images/ex2-lan-props2.png

Additional Resources

Official Flack Manual: http://www.protogeni.net/trac/protogeni/wiki/FlackManual

Resource Types

Throughout the examples, we’ve only seen the use of the standard computing resources available to us on GENI, like VMs and PCs. This section will go over some of the more commonly used resources that we haven’t seen yet, in to aspects of PCs and VMS that you may not have been exposed to yet.

Contents

Firewalls

Setting up a firewall in your GENI topology is as simple as dragging a node onto the experiment pane. Simply filter your list of resource types using the dropdown menu on the left. Select ‘firewall’:

_images/core-firewall-select.png

And drag it onto your experiment:

_images/core-firewall-select.png

You can network and configure the properties of a firewall just like you can with any other resource type. It’s just another node in the topology:

_images/core-firewall-types.png

In the properties window above, you can specify that the firewall is either open, closed, or basic.

  • Open: All traffic may flow freely
  • Closed: No traffic may flow
  • Basic: SSH and HTTP/HTTPs are allowed

Using an “open” style, you will be able to access the node to define rules at a later time.

Additional Resources

An emulab tutorial with more detail on firewalls: http://www.uky.emulab.net/tutorial/docwrapper.php3?docname=firewall.html

Physical Machines

Of the two computing resources you’ll have available to you on GENI, Physical Machines are one of them. They are most often referred to as “PC” or “PCs” in documentation and software tools.

Install A Specific Operating System

By default, GENI nodes get Fedora Core installed on them when created. You can override this by clicking into the properties of a PC and setting its operating system. Your choices are fairly standard: Ubuntu, Redhat, FreeBSD, or Fedora. Additionally, there are distros that come pre-packages with tools like KVM (Kernel Virtual Machine), which might be handy if you plan to host virtual machines, for instance.

_images/core-pc-select-os.png

Install Packages Automatically

If you have the URL to a package you would like to have installed for you, you can add an “install service”. When the machine is created, the package will be installed in the directory that you specify. This option is available in the properties pane of the PC.

_images/core-pc-install-package.png

Virtual Machines

Of the two computing resources you’ll have available to you on GENI, Virtual Machines are one of them. They are most often referred to as “VM” or “VMs” in documentation and software tools.

Virtual Machines are almost the same as PCs, with the exception that you are probably sharing compute resources with another VM on the host. Additionally, you don’t have the same ability to select from a set of available operating system for your node, as you do with a PC. You will be defaulted to the standard Emulab Fedora Core 6 image.

To see the configurable options for a PC, read more here.

Delay Node

A delay node is a type of resource with can simulate a data transfer bottleneck. This can be handy for running experiments that would ideally have some set speed of data transfer as opposed to whatever the network is capable of.

For instance, let’s say you are running a GENI experiment on a single site, where the inter-node data transfer speeds are 1000 Mbps. If you’re running an experiment that tests new protocols, it might make sense to run the experiment with different qualities of service and/or network characteristics.

Changing Network Characteristics

In the image below, we have two nodes that have yet to be networked together:

_images/core-delay-setup1.png

In the resource list drop down, we’re going to select the ‘delay’ option:

_images/core-delay-select1.png

From there, we’ll want to drag a delay node (or two) onto the pane

_images/core-delay-drag1.png

Finally, let’s drag links between the nodes so the LANs are set up automatically:

_images/core-delay-topology1.png

At this point, let’s click the i icon on the delay node. We’ll see a properties pane appear with areas to set capacity, latency, and packet loss on either incoming or outgoing traffic. At this time, capacity is in kb/s, latency in milliseconds, and packet loss as a number between 0 and 1.

_images/core-delay-extended-props.png

Apply your settings to finish it off.

GENI Resources

What kind of resources do you generally have available to you with GENI? This section describes setting up virtual machines, physical machines, networks, and more.

Contents

Simulating Gigabit Speeds

If you aren’t quite ready to set up a multi-site gigabit network, you can also simulate gigabit speeds with a special node type called a delay.

The delay node allows you to configure extra characterists such as link capacity, packet loss rates, and general latency. This is useful for capping your connection speed to other nodes, or simulating a less-than-desirable environment for your app. After all, in reality, latency and packet loss are real issues that must be dealt with.

Changing Network Speed Artificially

In the image below, we have two nodes that have yet to be networked together:

_images/core-delay-setup.png

In the resource list drop down, we’re going to select the ‘delay’ option:

_images/core-delay-select.png

From there, we’ll want to drag a delay node (or two) onto the pane

_images/core-delay-drag.png

Finally, let’s drag links between the nodes so the LANs are set up automatically:

_images/core-delay-topology.png

At this point, let’s click the i icon on the delay node. We’ll see a properties pane appear with an area to set the link capacity.

_images/core-delay-set-props.png

Apply your settings, and you can now build and run your app as if you’re on a gig network.

Real Gigabit Speeds

Getting an experiment or app up and running on GENI means that you have access to gigabit-speed networking. You might reserve one machine that will act as a server, and perhaps 9 others that will act as clients. Between them, you might have have high-speed gigabit connections.

As a web developer, building an app that depends on high speed is difficult — most end-users today aren’t on a gigabit-capable internet service, so it makes building such applications impractical or impossible. On GENI, although, you have the ability to run your app in an environment where speed isn’t an issue. You can truly build an app for the future.

The second example project, listed in the projects section, demonstrates how easy it is to get set up on a high speed connection within the GENI environment:

Programmable Networks

One of the most exciting aspects of GENI is that you are capable of experimenting with OpenFlow . OpenFlow is an open API that is implemented by some network hardware and software tools, allowing developers and network engineers define how their network is configured with software.

Contents

OpenFlow Basics

Note: This is a computer networking-focused document. It’s expected that you have basic knowledge of computer network architecture as specified in the What You Need to Know Before Starting.

Introduction

There is sometimes a need for network architects (or developers like you) to define the behavior of their networks in a custom manner. For example, the architect may want a network switch where they can control how packets are routed, or even define a custom protocol.

Historically, this was possible via closed, proprietary hardware that can be prohibitively expensive or impossible to obtain by researchers and experimenters. Yet, the need for this functionality exists in order to run wide-scale projects implementing new, experimental protocols, or even routing rules for basic network architecture needs.

OpenFlow is an API that a growing number of switch manufacturers (like IBM, or HP and its Procurve switch) are implementing, and it’s the leading architecture for Software defined Networking (SDN). It’s an open API that allows external software to define the routing rules, or “control plane” of routing hardware.

Igor Gashinsky gives an excellent overview on the need for SDN from an industry perspective below, but also illustrates the need to separate the control plane of a switch from the physical hardware.

Igor Gashinksy of Yahoo! At OpenFlow Symposium from Stephen Foskett on Vimeo.

OpenFlow is also implemented by Open vSwitch, a software-based switch you can install on an ordinary machine.

On the GENI network, you can request access to a physical OpenFlow-enabled Procurve, or simply install Open vSwitch on a machine and configure it from there.

Before going much further, you may want to know: What exactly can I do with OpenFlow?

What Can I Do With OpenFlow?

OpenFlow is the leading architecture of Software Defined Networking (SDN). It allows you to alter the routing rules of a compatible switch by giving you access to the control plane, or the part of the switch that decides how traffic is handled.

Examples of what you might do with OpenFlow [1]:

Keep reading to find out how you can get started with OpenFlow on the GENI network.

Footnotes

[1]A blog post on potential industry use-cases: http://blog.ioshints.info/2011/11/openflow-enterprise-use-cases.html

OpenFlow on GENI

There are a few different ways to start experimenting with OpenFlow on the GENI network:

  1. Install Open vSwitch on a standard GENI node
  2. Request access to the GENI Mesoscale Infrastructure
  3. Reserve one of the HP Switches in the GENI environment and install OpenFlow

Installing Open vSwitch

The preferred method for experimenters looking to play with OpenFlow is option #1. Open vSwitch is a software package which you can install on an ordinary node and have it act as a switch which implements OpenFlow.

This is also the easiest option with the lowest barrier to entry. The third tutorial, Programming Networks with OpenFlow will walk you through the exact steps required to make this work.

Using the GENI Mesoscale Infrastructure

GENI’s Mesoscale environment is a perfect place to run a large-scale OpenFLow experiment beyond a software-based option like Open vSwitch. Because this option requires coordination with the GENi Project Office (GPO), you may want to get you experiment running with Open vSwitch first, if that’s an option.

From there, reach out to help@geni.net for more information on obtaining a subnet for your experiment. A third-party, but detailed guide on how you might get your project running on the Mesoscale infrastructure is available on Github.

Reserve an HP Switch and install OpenFlow

This is an advanced option for getting up and running on OpenFlow. If you’re ambitious enough to reserve HP OpenFlow hardware, or simply have the need, reach out to help@geni.net for more information.

Additional Resources

Conclusion

At this point, you’ve been exposed to the most useful components of GENI for an app developer. The GENI platform is still being developed, however, and new services and tools for it are always being developed. It’s time to point you toward additional resources that cover the dark corners of the platform, should you need them.

Contents

Additional Resources

Here’s a list of resources that may be helpful to you as you explore new areas of GENI that may not of been discussed in this documentation.

  • The Main GENI Wiki: The documentation written by GENI experimenters and the GENI project office. This contains additional information on what other experimenters are using GENI for, and more projects for beginners.
  • The Protogeni Wiki: The documentation for Protogeni, a deployment of GENI. This contains both overlapping information in comparison with the Main GENI Wiki, and additional information as well.
  • Open vSwitch Documentation: The documentation for Open vSwitch, the software based switch used in the OpenFlow example project in these docs.

Additional Help

If you should need assistance, or have specific questions about GENI, send a note to the GENI Project Office at help@geni.net.

For issues with documentation, perhaps regarding something that is unclear, reach out to kenny@mozillafoundation.org.

Indices and tables