Introduction to GENI
The following is intended as a guide on how to use GENI for our course. Although we will walk through this procedure in class, please feel free to refer back to these notes as necessary.
Table of Contents
Introduction
GENI is a nationwide testbed for developing and conducting network or distributed experiments. There are many GENI racks with compute and networking resources scattered around the country, where we can reserve virtual machines (VMs), entire servers, programmable network switches, and layer 2/layer 3 links to interconnect our resources. Due to the distributed nature of GENI, resources can be reserved in strategic locations given a desired bandwidth or latency.
Clemson is a member of the GENI testbed with two GENI racks and a wireless testbed for conducting WiMAX, LTE, and WiFi experiments. GENI is programmable from the application layer where your programs run all the way down into the link layer where switches forward packets. As such, it is a very powerful and flexible testbed, especially for network experimenters and those interested in software defined networking research (as our research group is).
Given the above research benefits, GENI has other advantages that extend into the classroom. It is a great "sandbox" where you can get hands on experience with real, non-simulated networks. Not to mention, you do not have to worry about screwing up the network, since your environment is isolated from those of other experimenters and of production networks, such as the Internet.
Getting Started
Login to GENI
To use GENI, all you need is your Clemson username and password. GENI is federated with InCommon, so that we can use our existing accounts to use the service, just as we can use eduroam at other universities and places around the country and world without having to create additional accounts.
To access GENI, navigate in your favorite browser to http://portal.geni.net. From here, select Clemson University from the list or click the Clemson logo if you see it present already. Then, enter your Clemson username (omitting @clemson.edu) and password. You should be granted access to the GENI portal.
Create an SSH Public/Private Key Pair
Do not reserve resources before you have your public key generated/uploaded to GENI. You will be unable to access your resources if you omit this step. |
---|
Access to resources we reserve in GENI is granted through registered public keys only. We must use our public key's private counterpart when logging into GENI resources. After we reserve resources, such as a VM, our public keys will have already been uploaded to these resources, which serves as a whitelist. The real advantage is not having to enter any passwords when logging in. If you are prompted for a password when attempting to access a GENI resource you have reserved, (1) either the resource is not yours or your resource has not been fully initialized yet (i.e. your public key hasn't been copied to it yet) or (2) you are using the wrong private key when attempting to login.
After you have logged into GENI, you can browse to the top-right corner of the screen where it lists your email address/username. Hover over this and a dropdown menu will appear with "SSH Keys" as an option. Click "SSH Keys" and follow the instructions on the screen to generate and download your private key. Your public key will be loaded by GENI onto any resources you have reserved. You should use this private key in order to access the resources. Instructions are provided by GENI for both Windows and Mac/Linux users. If you're using Windows, I would highly recommend you use Mac or Linux.
Note, if you already have an SSH public/private key pair that you use regularly, you can upload it to GENI so that you do not have to manage yet another key pair.
Join a Project
I have already batch added everyone as members to the ece-4400-6400 project. Please check your email and accept the invite to complete the process. |
---|
Once in GENI, you must join a project in order to actually reserve resources. For this course, the project you should be a member of is ece-4400-6400. You can browse all available projects from the "Projects" tab. Please to not try to join projects other than the one for our course. Once you join a project, there is no need to rejoin in the future – you will be a member until the project is terminated.
Create your Topology
Aggregates, Slices, Slivers
In GENI, there are three terms you should become familiar with – aggregate, slice, and sliver. An aggregate is an entity registered with GENI that provides GENI resources, such as a rack consisting of GENI servers and network switches. An aggregate might also be a provider that creates links between GENI racks. A slice is your running experiment and might encompass multiple physical resources and/or racks around the country. You can think of a slice as your network topology including any end hosts you have attached to it. A sliver, on the other hand, defines your resources at a particular GENI location.
For example, if you were to reserve two VMs at both Clemson InstaGENI and Stanford InstaGENI with a layer 2 connection linking the VMs, your slice would be the four VMs and the tunnel (i.e. everything), whereas there would be three slivers – one at Clemson InstaGENI, one at Stanford InstaGENI, and one called AL2S (Advanced Layer 2 Services), which is responsible for establishing the link between the Clemson and Stanford slivers. The aggregates in this example are Clemson InstaGENI, Stanford InstaGENI, and AL2S. If you ever ask for help on geni-users@googlegroups.com, they might throw these terms at you, which is why I introduce them now.
RSPECs
In order to reserve your resources, you need to first define what those resources are. To do this, GENI uses resource specification files or rspecs for short. An rspec is an XML file where you can define your resources using certain XML tags. An example rspec is given below:
<?xml version="1.0" encoding="utf-8"?> <rspec expires="2015-04-07T13:40:37Z" type="manifest" xmlns="http://www.geni.net/resources/rspec/3" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab1" xmlns:jacks="http://www.protogeni.net/resources/rspec/ext/jacks/1" xmlns:tour="http://www.protogeni.net/resources/rspec/ext/apt-tour/1" xmlns:vtop="http://www.protogei.net/resources/rspec/ext/emulab/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/manifest.xsd"> <node client_id="client-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+node+pc2" component_manager_id="urn:publicid:DN+instageni.stanford.edu+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24452" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pc2.instageni.stanford.edu" port="33851" username="rizard01"/> <emulab:console server="pc2.instageni.stanford.edu"/> </services> <interface client_id="if-client-ovs-stan" component_id="rn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" mac_address="02e5da91e2bc" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24459"> <ip address="10.10.2.2" type="ipv4"/> </interface> <emulab:vnode name="pcvm2-12"/> <host name="client-stan.sos1.ch-geni-net.instageni.stanford.edu"/> </node> <node client_id="ovs-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+node+pc2" component_manager_id="urn:publicid:IDNinstageni.stanford.edu+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24453" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <routable_control_ip xmlns="http://www.protogeni.net/resources/rspec/ext/emulab/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pcvm2-13.instageni.stanford.edu" port="22" username="kwang01"/> <login authentication="ssh-keys" hostname="pcvm2-13.instageni.stanford.edu" port="22" username="rizard01"/> <emulab:console server="pcvm2-13.instageni.stanford.edu"/> </services> <interface client_id="link-stanford-max-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:eth0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24456"> <ip address="10.0.150.1" netmask="255.255.255.0" type="ipv4"/> </interface> <interface client_id="if-ovs-client-stan" component_id="rn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" mac_address="02547113add2" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24458"> <ip address="10.10.2.1" type="ipv4"/> </interface> <interface client_id="if-ovs-agent-stan" component_id="un:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" mac_address="0274b45e7138" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24462"> <ip address="10.10.3.2" type="ipv4"/> </interface> <emulab:vnode name="pcvm2-13"/> <host name="ovs-stan.sos1.ch-geni-net.instageni.stanford.edu"/> </node> <node client_id="agent-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+node+pc2" component_manager_id="urn:publicid:IN+instageni.stanford.edu+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24451" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pc2.instageni.stanford.edu" port="33850" username="kwang01"/> <login authentication="ssh-keys" hostname="pc2.instageni.stanford.edu" port="33850" username="rizard01"/> <emulab:console server="pc2.instageni.stanford.edu"/> </services> <interface client_id="if-agent-ovs-stan" component_id="un:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" mac_address="02b0b691cb89" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24461"> <ip address="10.10.3.1" type="ipv4"/> </interface> <emulab:vnode name="pcvm2-11"/> <host name="agent-stan.sos1.ch-geni-net.instageni.stanford.edu"/> </node> <node client_id="agent-max" component_id="urn:publicid:IDN+instageni.maxgigapop.net+node+pc3" component_manager_id="urn:publicid:ID+instageni.maxgigapop.net+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15668" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pc3.instageni.maxgigapop.net" port="32314" username="kwang01"/> <login authentication="ssh-keys" hostname="pc3.instageni.maxgigapop.net" port="32314" username="rizard01"/> <emulab:console server="pc3.instageni.maxgigapop.net"/> </services> <interface client_id="if-agent-ovs-max" component_id="urn:ublicid:IDN+instageni.maxgigapop.net+interface+pc3:lo0" mac_address="026b11909905" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15676"> <ip address="10.10.2.2" type="ipv4"/> </interface> <emulab:vnode name="pcvm3-1"/> <host name="agent-max.sos1.ch-geni-net.instageni.maxgigapop.net"/> </node> <node client_id="client-max" component_id="urn:publicid:IDN+instageni.maxgigapop.net+node+pc3" component_manager_id="urn:publicid:IN+instageni.maxgigapop.net+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15669" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pc3.instageni.maxgigapop.net" port="32315" username="kwang01"/> <login authentication="ssh-keys" hostname="pc3.instageni.maxgigapop.net" port="32315" username="rizard01"/> <emulab:console server="pc3.instageni.maxgigapop.net"/> </services> <interface client_id="if-client-ovs-max" component_id="urnpublicid:IDN+instageni.maxgigapop.net+interface+pc3:lo0" mac_address="02eb4374e711" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15679"> <ip address="10.10.3.2" type="ipv4"/> </interface> <emulab:vnode name="pcvm3-2"/> <host name="client-max.sos1.ch-geni-net.instageni.maxgigapop.net"/> </node> <node client_id="ovs-max" component_id="urn:publicid:IDN+instageni.maxgigapop.net+node+pc3" component_manager_id="urn:publicid:IDN+nstageni.maxgigapop.net+authority+cm" exclusive="false" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15670" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <icon url="https://portal.geni.net/images/VM-noTxt-centered.svg" xmlns="http://www.protogeni.net/resources/rspec/ext/jacks/1"/> <routable_control_ip xmlns="http://www.protogeni.net/resources/rspec/ext/emulab/1"/> <sliver_type name="default-vm"/> <services> <login authentication="ssh-keys" hostname="pcvm3-17.instageni.maxgigapop.net" port="22" username="kwang01"/> <login authentication="ssh-keys" hostname="pcvm3-17.instageni.maxgigapop.net" port="22" username="rizard01"/> <emulab:console server="pcvm3-17.instageni.maxgigapop.net"/> </services> <interface client_id="link-stanford-max-max" component_id="urn:publicid:IDN+instageni.maxgigapop.net+interface+pc3:eth0" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15673"> <ip address="10.0.150.2" netmask="255.255.255.0" type="ipv4"/> </interface> <interface client_id="if-ovs-agent-max" component_id="urn:ublicid:IDN+instageni.maxgigapop.net+interface+pc3:lo0" mac_address="025b1bc80530" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15675"> <ip address="10.10.2.1" type="ipv4"/> </interface> <interface client_id="if-ovs-client-max" component_id="urnpublicid:IDN+instageni.maxgigapop.net+interface+pc3:lo0" mac_address="0206b1582723" sliver_id="urn:publicid:IDN+instageni.maxgigapop.net+sliver+15678"> <ip address="10.10.3.1" type="ipv4"/> </interface> <emulab:vnode name="pcvm3-17"/> <host name="ovs-max.sos1.ch-geni-net.instageni.maxgigapop.net"/> </node> <link client_id="link-stanford-max" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24455" xmlns:vtop="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <link_type name="egre-tunnel"/> <interface_ref client_id="link-stanford-max-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:eth0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24456"/> <interface_ref client_id="link-stanford-max-max"/> <component_manager name="urn:publicid:IDN+instageni.stanford.edu+authority+cm"/> <component_manager name="urn:publicid:IDN+instageni.maxgigapop.net+authority+cm"/> <vtop:link_attribute key="nomac_learning" value="yep"/> <property capacity="150000" dest_id="link-stanford-max-max" source_id="link-stanford-max-stan"/> </link> <link client_id="link-client-ovs-stan" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24457" xmlns:vtop="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <interface_ref client_id="if-ovs-client-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24458"/> <interface_ref client_id="if-client-ovs-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24459"/> <component_manager name="urn:publicid:IDN+instageni.stanford.edu+authority+cm"/> <vtop:link_attribute key="nomac_learning" value="yep"/> <property capacity="150000" dest_id="if-client-ovs-stan" source_id="if-ovs-client-stan"/> </link> <link client_id="link-agent-ovs-stan" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24460" xmlns:vtop="http://www.protogeni.net/resources/rspec/ext/emulab/1"> <interface_ref client_id="if-agent-ovs-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24461"/> <interface_ref client_id="if-ovs-agent-stan" component_id="urn:publicid:IDN+instageni.stanford.edu+interface+pc2:lo0" sliver_id="urn:publicid:IDN+instageni.stanford.edu+sliver+24462"/> <component_manager name="urn:publicid:IDN+instageni.stanford.edu+authority+cm"/> <vtop:link_attribute key="nomac_learning" value="yep"/> <property capacity="150000" dest_id="if-ovs-agent-stan" source_id="if-agent-ovs-stan"/> </link> <link client_id="link-agent-ovs-max" xmlns="http://www.geni.net/resources/rspec/3"> <interface_ref client_id="if-ovs-agent-max" xmlns="http://www.geni.net/resources/rspec/3"/> <interface_ref client_id="if-agent-ovs-max" xmlns="http://www.geni.net/resources/rspec/3"/> <component_manager name="urn:publicid:IDN+instageni.maxgigapop.net+authority+cm" xmlns="http://www.geni.net/resources/rspec/3"/> <vtop:link_attribute key="nomac_learning" value="yep"/> <property capacity="150000" dest_id="if-agent-ovs-max" source_id="if-ovs-agent-max"/> </link> <link client_id="link-client-ovs-max" xmlns="http://www.geni.net/resources/rspec/3"> <interface_ref client_id="if-ovs-client-max" xmlns="http://www.geni.net/resources/rspec/3"/> <interface_ref client_id="if-client-ovs-max" xmlns="http://www.geni.net/resources/rspec/3"/> <component_manager name="urn:publicid:IDN+instageni.maxgigapop.net+authority+cm" xmlns="http://www.geni.net/resources/rspec/3"/> <vtop:link_attribute key="nomac_learning" value="yep"/> <property capacity="150000" dest_id="if-client-ovs-max" source_id="if-ovs-client-max"/> </link> <rs:site_info xmlns:rs="http://www.protogeni.net/resources/rspec/ext/site-info/1"> <rs:location country="US" latitude="37.43" longitude="-122.17"/> </rs:site_info> <rs:site_info xmlns:rs="http://www.protogeni.net/resources/rspec/ext/site-info/1"> <rs:location country="US" latitude="38.970941" longitude="-76.921971"/> </rs:site_info> </rspec>
Now, that looks nasty. And up until a year or so ago, we were writing these by hand. Lucky for you – the next generation of GENI users – there is Jacks.
Jacks
Jacks is a JavaScript-based GUI where you can define your slices in graphical way without the need to actually write an rspec by hand. There are some types of exotic slices that still require "massaging" an rspec manually in order to get the exact topology needed. However, for this course, everything we do will be straightforward enough to use Jacks.
For our demo topology, we'll create a linear LAN consisting of a switch and two end hosts. Each end host will be connected to the switch via a point-to-point link.
To create a slice with Jacks, from the GENI dashboard, perform the following steps:
- Select "New Slice".
- Then, under our course project, give the slice a name, optionally a description, and click "Create Slice".
- Next, we'll want to add resources to the slice by selecting "Add Resources" on the slice's page.
- At this point, Jacks has been launched, and we can drag and drop VMs, physical servers, links, and aggregates/sites to create our topology.
- Start by choosing an aggregate for your site. Select "Site 1", and choose some XXX InstaGENI aggregate from the list. Note that GPO InstaGENI and other racks close to the top of the list are typically used more often, as they are the low-hanging fruit. I will use Clemson InstaGENI for an example, but you should use either what has been assigned or what looks to be available based on the XEN server load for each aggregate.
- Next, drag three XEN VMs to the canvas. Because we do not have more than one site in this demo, the VMs can be dropped anywhere and they will be a part of Site 1.
- The VMs we've added to our slice have default names; however, it's recommended they be renamed to something more meaningful. For this demo, we'll have two end hosts and a switch interconnecting them. Thus, let's name "node-0" "host-1" and "node-2" "host-2". Likewise, we can name "node-1" "switch" instead. It is important the names be unique in your slice. To edit any property of a VM, simply select the VM and a panel will appear with a list of options to scroll through, one of which is the "Name" of the VM.
- At this point, we've named our VMs, but we haven't specified the operating system (OS). A good general-purpose OS is "Ubuntu 14 with OVS by Niky". It includes everything necessary to make a VM function as either a switch or an end host. As such, we'll use it in this demo and throughout the course. The OS can be selected for each VM by modifying the "Disk Image" parameter using the same technique we used to modify the VM names.
- The next step after creating the VMs is to link them up. For us, we want the two end host VMs to be linked together via the switch VM. Thus, we'll create two links by hovering over a VM and slowly moving the cursor away. A black line will appear, at which point we can click and drag to the VM where we want then link to terminate. For our demo topology, we'll create a link between "host-1" and "switch" and between "host-2" and "switch".
- The final topology appears as follows.
It's a good idea to back up our topologies so that we can reuse them without having to draw them over again. Underneath the Jacks canvas are ways to export and import existing rspecs. To download the rspec representing the topology we've drawn, select "Download".
Note that if you want to scroll in the webpage, you must first move the cursor to outside the Jacks canvas.
If in the future, we wish to reference the downloaded rspec in a new slice, we can select the "File" radio button, and select "Choose File". Browse to the rpsec, select it, and Jacks will render it on the canvas where we can then add to it, remove from it, or simply reserve it as-is.
Reserve your Resources
At this point, we have defined our topology by means of a slice; however, it's only on paper and doesn't exist anywhere. To reserve the resources we've asked for, simply follow these steps:
- Click the "Reserve Resources" button underneath the Jacks canvas at the bottom of the webpage.
- This will prompt a new page to load in which you can view the reservation's status.
- Do not leave this page until the timer has stopped and indicates "Finished". This page will tell us if there is an error in our reservation, so it is important that we wait to verify everything checked out okay. If we were to see an error, it's likely due to rack oversubscription or maintenance. Go back to Jacks, and try a different aggregate. Upon success, we should see a list of all the resources per aggregate along with SSH login information for each machine.
- Go back to your slice by selecting your slice in the path (i.e. Home->Project ece-4400-6400->Slice do-not-name-test->Add Resources to do-not-name-test) at the top of the screen. Here, my slice name is "do-not-name-test" (which is a name you should never give your slice, as it has the word "test" in it).
- This will take us back to the main page for the slice, where we must wait for our resources to be allocated and booted. Depending on how busy the aggregate is and how complex your slice is, this may take a few minutes. Go get some coffee.
- The VMs will turn green when they are ready.
- If you need the SSH login information, select a VM and copy-and-paste your username's login info to the terminal or Putty. Note that the SSH port is denoted by the colon after the domain name.
Above, you'll see that my browser displayed the pane on the left such that the SSH port is cut off. If this happens to you, to make sure you copy the entire port, double-click the port, then press and hold shift and repeatedly press the left arrow key until you've selected the entire string to the beginning of your username. Then, copy it.
Alternatively, you can select "View Rspec" and see your SSH info in raw form. This is also a good way to feel appreciation for Jacks and be thankful that you don't have to write this by hand
Accessing Resources
Once we have our slice reserved, and we've waited patiently for our resources to be allocated by the aggregate(s), we can SSH into our resources and configure them to our liking.
If you're using Windows:
- I'm sorry; you might want to consider a Linux VM or dual-booting Linux.
- If you insist on using Windows, you'll need Putty or some SSH client to get to your resources. You should follow the instructions for the client you choose.
If you're using a Mac or Linux:
- Open up a terminal for each GENI VM where you want to login (i.e. three terminal windows for this intro tutorial).
- SSH into each of your resources using your GENI username, the host and domain name of your resource given by the steps above, the port provided, and the path to your downloaded private key. To specify the port number the SSH server has open for you, use the -p SSH flag. To tell your SSH client to use the private key you downloaded from GENI, use the -i flag. For example:
- Repeat step 2 for each GENI resource that you want to login to.
- Pro tip: Optionally, add your private key to your SSH agent so that it will automatically be tried when you SSH. Use the passphrase you set for the key when you created it on the GENI portal. If you do this, you will not need the -i flag to access any GENI resources in the future.
Handy Networking Commands
In this course, the projects will require you be familiar with some basic networking tools. This is by no means a comprehensive guide, but it will give you some skills to become dangerous.
ifconfig
ifconfig stands for network "interface configuration". It allows you to not only view information about your system's current network settings, but it also allows you to modify the running configuration.
View Interfaces
Only Interfaces that are Up
All Interfaces, Both Up and Down
View a Specific Interface
Modify an Interface
There are many things we can do to a network interface using ifconfig. One simple example is to bring an interface up that is down.
route
The route command allows you to see the current routes configured on the system, as well as add and remove existing routes.
View Routes
The -n flag tells the kernel to not resolve host names, which IMHO is easier to reason with when working with IP networks.
Add a Route
The gw <IP-of-gateway> parameter can be omitted if the route does not have a next hop gateway.
Remove a Route
When removing a route, simply use the exact same syntax used when adding the route, but change the "add" to a "del".
tcpdump
tcpdump is a stripped down version of Wireshark that allows us to view packets that are actively entering or exiting the network interfaces of a machine. There are countless tcpdump filters to get the output to show only what we're interested in. Here's a basic example that will show all ARP and ICMP packets on interface eth1. The trailing -e flag is to show Ethernet headers (MAC addresses), and the -vv is to increase the verbosity.
We can also use the -n flag to tell tcpdump to not resolve the host domain names and just give us the raw IP addresses instead. I find this mode of operation easier to follow.
ovs-vsctl
We can create a switch using the open source Open vSwitch (OVS) project. It comes with many command line utilities, one of which is ovs-vctl (OVS virtual switch control). These will only be installed if you use the "Ubuntu 14 with OVS by Niky" image.
To add a virtual switch:
Any interface shown in ifconfig can be added as a port to a previously created OVS virtual switch. To add a port to a virtual switch:
To undo any of the above OVS operations, replace "add" in the command with "del", e.g. "add-br" becomes "del-br" and "add-port" becomes "del-port". There are many other OVS commands we won't discuss here (or yet, rather) that follow the same convention.
To view all running switch configurations:
Here is a presentation that covers other useful OVS commands, many of which are beyond the scope of this tutorial but might still be useful. Topics covered include bridge configuration, OpenFlow, and spanning tree to name a few.