Ping Familiarization Project Part One

by: burt rosenberg
at: university of miami


Tools of the trade

Ping!

This is a project to get you familiarized with the tools we will make use of this semester.

A word of caution: It is not cool to monitor or collect packets of other people's conversations. The exercises in this course are designed so that this will not be possible. We will be working on various private and virtual networks that isolate our conversations.

However, the networking tools we use can be used to read packets for your own projects outside of this class. In those situations, you might be in a situation to access communications other than your own. Please take care that in such a situation your actions are appropriate.

Steps ...

  1. Install Virtual Box
  2. Create a virtual machine and install Ubuntu 12.04 LTS.
  3. Update all your software.
  4. Install subversion on Ubuntu.
  5. Connect to your repository.

Install Virtual Box

Download and install Virtual Box.

The popularity of virtual machines have made them familiar to almost everyone. The idea of a virtual machine is that the "real machine", your laptop for instance, can emulate in software the hardware of another computer. You can install a complete operating system to be run by this software simulation. The real machine is called the host and any of the virtual machines is called the guest. The keyboard, mouse and screen of the host are made available to the guest by re-routing requests to the simulated computer made by the guest, through the host, to the actual keyboard, mouse and screen.

Virtual machines are an astonishing old technology. It was introduced by IBM in 1967 for the IBM System 360 mainframe. Originally mainframes, and all computers, handled tasks serially – one at a time. As a quick way to handle customer requests for more flexibility, IBM cloned the hardware using virtual machines so that one IBM System 360 could run multiple copies of the operating system, each a serial operating system, but now there were several serial operating systems.

More recently virtual machines allow users of one operating system to run programs written exclusively for another operating system. A web designer using a Mac must see how the web pages look on a Windows PC and rather than buying another computer the designer could install a virtual machine and run Windows in the virtual machine.

Create a virtual machine and install Ubuntu 12.04 LTS.

Either desktop or server is fine. For the purpose of being specific, I would use the 32-bit server edition. The 64-bit desktop edition is also offered. Either should be fine. On the Amazon Web Services machine we will be using the 32-bit server and you will not have a desktop.

No desktop is a bit old-school. Unix people prefer no desktop for certain work. Younger people are very used to desktops because desktops are nicer, no doubt about it. Mostly you don't have hundreds of commands to remember. Also, Windows is pretty insistent about desktops. Unlike Unix, Windows desktop is built deeply into their operating system and even system administrators are avid desktop users. Unix the desktop is completely separate from the operating system, it comes from an entirely separate bunch of developers, and as a Unix user you have your choice of desktops, or none at all. Furthermore, Unix system administrators tend to avoid desktops.

Personally I adopt a mixed model. I am a heavy desktop user on my local machine, very concerned about the quality of interface and always seeking apparent (if not true!) simplicity and convenience, but treat my local machine as the gateway to other machines scattered around the world, and those machines are expected to work through precise, machine-like API's, or text interfaces that can be fully automated.

Our use of subversion is an example of this. If you wanted to work on a desktop, as long as the repository is accessible from your local machine, you can do all editing as if the files were local; syncing to target machine, the edited files are immediately available to your various run machines.

Unable to display content. Adobe Flash is required.

Update all your software.

The ISO image you downloaded is an LTS, Long Term Support. That means that the software is pretty stable, has a long guaranteed lifetime for support, and will not be updated to add features. However, as with all software, it must be kept up-to-date with the latest fixes. "Distro's" (distributions) are all about the installation and maintenance of your software to make sure you have the software you need, and that it is up-to-date. "APT" is a wrapper around the basic software distribution technology of Ubuntu (and all Debian derived Linux flavors). It keeps a local database of what is installed on your system, and references an on-line database to find download packages to download, track dependencies between packages, and package updates.

Update first your database, and then all your software by:

  sudo apt-get update
  sudo apt-get upgrade

Install subversion on Ubuntu.

You can access your subversion repository from the internet using the svn URL and subversion client software. You will need to have or install the subversion client software, the command "svn". OSX ships with svn native. If your Ubuntu (or other Debian derived) image does not have svn, install it with apt-get. Periodically, apt-get needs its indexing of installables refreshed. Use:

  sudo apt-get update
then:
  sudo apt-get install subversion

Connect to your repository, introduction.

Subversion is a source code control system (sccs). It is a software system designed to allow large programming teams collaborate in a software project. SCCS's are the one of the oldest forms of what is now termed "collaboration-ware", and has sophisticated mechanisms to allow for collaboration.

The subversion system has a "source-of-truth" being a repository of the software, a.k.a. "the code base", that is stored on-line in a server. Programmers pull copies of the repository to their local machines, work on the software, and copy back the changes in an explicit push action called a commit. Until you commit, nothing changes in the repository. All during your editing of your local files, the client half of subversion keeps track of your changes, as well as files added, files deleted, and files moved. But nothing happens in the code base until you commit those changes.

The copy down from the repository is called a check-out, or if you have already checked-out the software but want to update to the newest revision, an update. Nothing is really checked-out in a check out. A check-out makes copy of the repository to your local drives, and hidden .svn directories are made inside the file structure of the copy to record the circumstances of the check-out:

Examples: Sample work flows:

In this class, it will only happen by error that you will attempt to check-in a file, but subversion with demur. It might claim to have a conflict. A conflict is when you edit a file that is version X and then try to commit it back but the file in the repository is now version Y, with Y larger than X. This means someone has modified and committed back changes to the file while you were working with a local copy on your machine. Subversion has conflict-resolution methods that include ignoring your changes, ignoring the repository changes, or merging the changes.

Connect to your repository, details.

In order to check out your repository you will need to know it's URL – the internet standard reference for resource location. You will need to choose a location on your local machine for the copy, but this doesn't matter to me or to subversion. It will create a new directory and place the copy in that directory according to your wishes.

The URL of this semester is:

   svn://svn.cs.miami.edu/classes/csc524.142
If you are a visitor from the future, welcome, but being from the future you are probably smart enough to know that most likely the path part of the URL you want will be different, but you should be able to figure it out.

(Unless people of the future have yielded to the will of Canelink, in which case it may or may not be renumbered unpredictably according to an incomplete and ambiguous method for the sake of avoiding Y2K problems ...)

You will also need a username and a password. The security is not great. Don't submit the secret recipe for your award winning hot sauce using this implementation of subversion. The subversion client will remember you username and password, so you will only have to give it once, or again if your username or password changes. The option --username will force subversion to use a username different that the previous username used, and is useful for the first checkout. Assuming csc524.repo is the name of the folder you wish to create on your local machine, and your username is myname, then:

   svn co --username myname --password mypassword svn://svn.cs.miami.edu/classes/csc524.142 csc524.repo

Make your quiz directory and add it:

   mkdir quiz ; svn add quiz
If you are taking the course of writing credit, make your writing-credit directory and add it:
   mkdir writing-credit ; svn add writing-credit
Try out a test file and add it:
   echo "Hello world!" > test.txt ; svn add test.txt
And commit the entire bundle of changes:
   svn commit -m "my first commit"
Done. You may now erase the entire csc524.repo directory and check it out again to see that the changes are safe in the repository.

Refer to my subversion tutorial and to the subversion turtle book for more information.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Author: Burton Rosenberg
Created: January 18, 2014
Last Update: January 18, 2014